Explicitly pass the “state” param in notifications_*_procedure methods

This commit is contained in:
Nicolas Bouilleaud 2019-09-20 10:35:44 +02:00
parent 8a06c01f13
commit 769621de46
4 changed files with 13 additions and 13 deletions

View file

@ -248,7 +248,7 @@ describe Instructeur, type: :model do
instructeur_2.followed_dossiers << dossier
end
subject { instructeur.notifications_for_procedure(procedure) }
subject { instructeur.notifications_for_procedure(procedure, :en_cours) }
context 'when the instructeur has just followed the dossier' do
it { is_expected.to match([]) }
@ -258,8 +258,8 @@ describe Instructeur, type: :model do
before { dossier.champs.first.update_attribute('value', 'toto') }
it { is_expected.to match([dossier.id]) }
it { expect(instructeur_2.notifications_for_procedure(procedure)).to match([dossier.id]) }
it { expect(instructeur_on_procedure_2.notifications_for_procedure(procedure)).to match([]) }
it { expect(instructeur_2.notifications_for_procedure(procedure, :en_cours)).to match([dossier.id]) }
it { expect(instructeur_on_procedure_2.notifications_for_procedure(procedure, :en_cours)).to match([]) }
context 'and there is a modification on private champs' do
before { dossier.champs_private.first.update_attribute('value', 'toto') }
@ -273,7 +273,7 @@ describe Instructeur, type: :model do
before { follow.update_attribute('demande_seen_at', Time.zone.now) }
it { is_expected.to match([]) }
it { expect(instructeur_2.notifications_for_procedure(procedure)).to match([dossier.id]) }
it { expect(instructeur_2.notifications_for_procedure(procedure, :en_cours)).to match([dossier.id]) }
end
end
@ -315,7 +315,7 @@ describe Instructeur, type: :model do
let(:instructeur) { dossier.follows.first.instructeur }
let(:procedure) { dossier.procedure }
subject { instructeur.notifications_per_procedure }
subject { instructeur.notifications_per_procedure(:en_cours) }
context 'when there is a modification on public champs' do
before { dossier.champs.first.update_attribute('value', 'toto') }