DossierController: a archived dossier is not followed
This commit is contained in:
parent
19b3416361
commit
e20d403b20
2 changed files with 4 additions and 0 deletions
|
@ -40,6 +40,7 @@ module NewGestionnaire
|
||||||
|
|
||||||
def archive
|
def archive
|
||||||
dossier.update_attributes(archived: true)
|
dossier.update_attributes(archived: true)
|
||||||
|
current_gestionnaire.unfollow(dossier)
|
||||||
redirect_back(fallback_location: procedures_url)
|
redirect_back(fallback_location: procedures_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -55,12 +55,15 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
|
|
||||||
describe '#archive' do
|
describe '#archive' do
|
||||||
before do
|
before do
|
||||||
|
gestionnaire.follow(dossier)
|
||||||
patch :archive, params: { procedure_id: procedure.id, dossier_id: dossier.id }
|
patch :archive, params: { procedure_id: procedure.id, dossier_id: dossier.id }
|
||||||
dossier.reload
|
dossier.reload
|
||||||
|
gestionnaire.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(dossier.archived).to be true }
|
it { expect(dossier.archived).to be true }
|
||||||
it { expect(response).to redirect_to(procedures_url) }
|
it { expect(response).to redirect_to(procedures_url) }
|
||||||
|
it { expect(gestionnaire.followed_dossiers).not_to include(dossier) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#unarchive' do
|
describe '#unarchive' do
|
||||||
|
|
Loading…
Reference in a new issue