Skip to content

Commit 5ced1e9

Browse files
committed
fix test
1 parent 95bce35 commit 5ced1e9

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

spec/controllers/administrateurs/groupe_instructeurs_controller_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ def remove_instructeur(instructeur)
949949
end
950950

951951
let!(:drop_down_tdc) { procedure3.draft_revision.types_de_champ.first }
952-
let!(:dossier) { create(:dossier, procedure: procedure3, state: :en_construction) }
952+
let!(:dossier) { create(:dossier, :en_construction, procedure: procedure3) }
953953

954954
before { post :create_simple_routing, params: { procedure_id: procedure3.id, create_simple_routing: { stable_id: drop_down_tdc.stable_id } } }
955955

@@ -1137,9 +1137,9 @@ def remove_instructeur(instructeur)
11371137
end
11381138

11391139
let!(:drop_down_tdc) { procedure.draft_revision.types_de_champ.first }
1140-
let!(:dossier1) { create(:dossier, :with_populated_champs, procedure: procedure, state: :en_construction) }
1141-
let!(:dossier2) { create(:dossier, :with_populated_champs, procedure: procedure, state: :en_construction) }
1142-
let!(:dossier3) { create(:dossier, :with_populated_champs, procedure: procedure, state: :accepte) }
1140+
let!(:dossier1) { create(:dossier, :en_construction, :with_populated_champs, procedure: procedure) }
1141+
let!(:dossier2) { create(:dossier, :en_construction, :with_populated_champs, procedure: procedure) }
1142+
let!(:dossier3) { create(:dossier, :accepte, :with_populated_champs, procedure: procedure) }
11431143

11441144
before do
11451145
dossier1.champs.first.update(value: 'Paris')

spec/jobs/bulk_route_job_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
end
1515

1616
let!(:drop_down_tdc) { procedure.draft_revision.types_de_champ.first }
17-
let!(:dossier1) { create(:dossier, :with_populated_champs, procedure: procedure, state: :en_construction) }
18-
let!(:dossier2) { create(:dossier, :with_populated_champs, procedure: procedure, state: :en_construction) }
19-
let!(:dossier3) { create(:dossier, :with_populated_champs, procedure: procedure, state: :accepte) }
17+
let!(:dossier1) { create(:dossier, :en_construction, :with_populated_champs, procedure: procedure) }
18+
let!(:dossier2) { create(:dossier, :en_construction, :with_populated_champs, procedure: procedure) }
19+
let!(:dossier3) { create(:dossier, :accepte, :with_populated_champs, procedure: procedure) }
2020
let!(:groupe_instructeur_paris) { create(:groupe_instructeur, procedure: procedure, label: 'Paris', routing_rule: ds_eq(champ_value(drop_down_tdc.stable_id), constant('Paris'))) }
2121
let!(:groupe_instructeur_lyon) { create(:groupe_instructeur, procedure: procedure, label: 'Lyon', routing_rule: ds_eq(champ_value(drop_down_tdc.stable_id), constant('Lyon'))) }
2222
let!(:groupe_instructeur_marseille) { create(:groupe_instructeur, procedure: procedure, label: 'Marseille', routing_rule: ds_eq(champ_value(drop_down_tdc.stable_id), constant('Marseille'))) }

spec/models/dossier_notification_spec.rb

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,15 @@
106106
let!(:other_groupe_instructeur) { create(:groupe_instructeur, instructeurs: [instructeur]) }
107107
let!(:dossier) { create(:dossier, :accepte, groupe_instructeur:) }
108108
let!(:other_dossier) { create(:dossier, :en_construction, groupe_instructeur: other_groupe_instructeur) }
109-
let!(:notification_instructeur) { create(:dossier_notification, :for_instructeur, dossier:, instructeur:) }
110-
let!(:notification_grp_instructeur) { create(:dossier_notification, :for_groupe_instructeur, dossier:, groupe_instructeur:) }
111-
let!(:other_notification_instructeur) { create(:dossier_notification, :for_instructeur, dossier: other_dossier, instructeur:) }
112-
let!(:other_notification_grp_instructeur) { create(:dossier_notification, :for_groupe_instructeur, dossier: other_dossier, groupe_instructeur: other_groupe_instructeur) }
109+
let!(:notification_instructeur) { create(:dossier_notification, :for_instructeur, dossier:, instructeur:, notification_type: :dossier_modifie) }
110+
let!(:other_notification_instructeur) { create(:dossier_notification, :for_instructeur, dossier: other_dossier, instructeur:, notification_type: :dossier_modifie) }
113111

114112
context 'a given instructeur and one dossier' do
115113
subject { DossierNotification.notifications_for_instructeur_dossier(instructeur, dossier) }
116114

117115
it 'includes correct notifications and excludes the others' do
118116
is_expected.to include(notification_instructeur)
119-
is_expected.to include(notification_grp_instructeur)
120117
is_expected.not_to include(other_notification_instructeur)
121-
is_expected.not_to include(other_notification_grp_instructeur)
122118
end
123119
end
124120

@@ -129,9 +125,7 @@
129125

130126
it 'includes correct notifications and excludes the others' do
131127
expect(subject[dossier.id]).to include(notification_instructeur)
132-
expect(subject[dossier.id]).to include(notification_grp_instructeur)
133128
expect(subject[other_dossier.id]).to include(other_notification_instructeur)
134-
expect(subject[other_dossier.id]).to include(other_notification_grp_instructeur)
135129
end
136130
end
137131

@@ -141,10 +135,8 @@
141135
subject { DossierNotification.notifications_for_instructeur_procedure(groupe_instructeur_ids, instructeur) }
142136

143137
it 'includes correct notifications and excludes the others' do
144-
expect(subject['traites']['dossier_depose']).to include(notification_instructeur)
145-
expect(subject['traites']['dossier_depose']).to include(notification_grp_instructeur)
146-
expect(subject['a-suivre']['dossier_depose']).to include(other_notification_instructeur)
147-
expect(subject['a-suivre']['dossier_depose']).to include(other_notification_grp_instructeur)
138+
expect(subject['traites']['dossier_modifie']).to include(notification_instructeur)
139+
expect(subject['a-suivre']['dossier_modifie']).to include(other_notification_instructeur)
148140
end
149141
end
150142
end

0 commit comments

Comments
 (0)