Dossier: prove a hidden dossier is no more followed
This commit is contained in:
parent
e20d403b20
commit
ffe131322e
1 changed files with 4 additions and 0 deletions
|
@ -408,17 +408,21 @@ describe Procedure do
|
||||||
let(:procedure) { create(:procedure) }
|
let(:procedure) { create(:procedure) }
|
||||||
let!(:dossier) { create(:dossier, procedure: procedure) }
|
let!(:dossier) { create(:dossier, procedure: procedure) }
|
||||||
let!(:dossier2) { create(:dossier, procedure: procedure) }
|
let!(:dossier2) { create(:dossier, procedure: procedure) }
|
||||||
|
let(:gestionnaire) { create(:gestionnaire) }
|
||||||
|
|
||||||
it { expect(Dossier.count).to eq(2) }
|
it { expect(Dossier.count).to eq(2) }
|
||||||
it { expect(Dossier.all).to include(dossier, dossier2) }
|
it { expect(Dossier.all).to include(dossier, dossier2) }
|
||||||
|
|
||||||
context "when hidding procedure" do
|
context "when hidding procedure" do
|
||||||
before do
|
before do
|
||||||
|
gestionnaire.followed_dossiers << dossier
|
||||||
procedure.hide!
|
procedure.hide!
|
||||||
|
gestionnaire.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(procedure.dossiers.count).to eq(0) }
|
it { expect(procedure.dossiers.count).to eq(0) }
|
||||||
it { expect(Dossier.count).to eq(0) }
|
it { expect(Dossier.count).to eq(0) }
|
||||||
|
it { expect(gestionnaire.followed_dossiers).not_to include(dossier) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue