test fonctionnel notification champ
This commit is contained in:
parent
1fafcad401
commit
b7b61e79ab
1 changed files with 16 additions and 0 deletions
|
@ -682,6 +682,22 @@ describe Users::DossiersController, type: :controller do
|
||||||
it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_construction)) }
|
it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_construction)) }
|
||||||
it { expect(response).to redirect_to(demande_dossier_path(dossier)) }
|
it { expect(response).to redirect_to(demande_dossier_path(dossier)) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when the dossier is followed by an instructeur' do
|
||||||
|
let(:dossier) { create(:dossier) }
|
||||||
|
let(:instructeur) { create(:instructeur) }
|
||||||
|
let!(:invite) { create(:invite, dossier: dossier, user: user) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
instructeur.follow(dossier)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'the follower has a notification' do
|
||||||
|
expect(instructeur.reload.followed_dossiers.with_notifications(instructeur)).to eq([])
|
||||||
|
subject
|
||||||
|
expect(instructeur.reload.followed_dossiers.with_notifications(instructeur)).to eq([dossier.reload])
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#index' do
|
describe '#index' do
|
||||||
|
|
Loading…
Reference in a new issue