Delete tab Nouveau A traiter and En cours d'étude for User and replace this only one call En construction
This commit is contained in:
parent
fd9eaa5a4d
commit
a7166d306f
9 changed files with 110 additions and 87 deletions
|
@ -125,6 +125,43 @@ describe DossiersListGestionnaireService do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#join_filter' do
|
||||
|
||||
subject { DossiersListGestionnaireService.new(gestionnaire, liste, nil).joins_filter }
|
||||
|
||||
it { is_expected.to eq []}
|
||||
|
||||
context 'when a filter is fielded' do
|
||||
before do
|
||||
gestionnaire.preference_list_dossiers
|
||||
.find_by(table: 'entreprise', attr: 'raison_sociale', procedure: nil)
|
||||
.update_column :filter, 'plop'
|
||||
end
|
||||
|
||||
it { is_expected.to eq [:entreprise] }
|
||||
end
|
||||
|
||||
context 'when a filter is empty' do
|
||||
before do
|
||||
gestionnaire.preference_list_dossiers
|
||||
.find_by(table: 'entreprise', attr: 'raison_sociale', procedure: nil)
|
||||
.update_column :filter, ''
|
||||
end
|
||||
|
||||
it { is_expected.to eq [] }
|
||||
end
|
||||
|
||||
context 'when a filter is nil' do
|
||||
before do
|
||||
gestionnaire.preference_list_dossiers
|
||||
.find_by(table: 'entreprise', attr: 'raison_sociale', procedure: nil)
|
||||
.update_column :filter, nil
|
||||
end
|
||||
|
||||
it { is_expected.to eq [] }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#where_filter' do
|
||||
before do
|
||||
gestionnaire.preference_list_dossiers
|
||||
|
@ -181,6 +218,16 @@ describe DossiersListGestionnaireService do
|
|||
it { is_expected.to eq "CAST(dossiers.id as TEXT) LIKE '%23%' AND CAST(entreprises.raison_sociale as TEXT) LIKE '%MCDONALD''S FRANCE%'" }
|
||||
end
|
||||
|
||||
context "when filter is empty " do
|
||||
before do
|
||||
gestionnaire.preference_list_dossiers
|
||||
.find_by(table: 'entreprise', attr: 'raison_sociale', procedure: nil)
|
||||
.update_column :filter, ""
|
||||
end
|
||||
|
||||
it { is_expected.to eq "CAST(dossiers.id as TEXT) LIKE '%23%'" }
|
||||
end
|
||||
|
||||
context 'when preference list contain a champ' do
|
||||
before do
|
||||
create :preference_list_dossier,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue