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
|
||||
dossier.update_attributes(archived: true)
|
||||
current_gestionnaire.unfollow(dossier)
|
||||
redirect_back(fallback_location: procedures_url)
|
||||
end
|
||||
|
||||
|
|
|
@ -55,12 +55,15 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
|||
|
||||
describe '#archive' do
|
||||
before do
|
||||
gestionnaire.follow(dossier)
|
||||
patch :archive, params: { procedure_id: procedure.id, dossier_id: dossier.id }
|
||||
dossier.reload
|
||||
gestionnaire.reload
|
||||
end
|
||||
|
||||
it { expect(dossier.archived).to be true }
|
||||
it { expect(response).to redirect_to(procedures_url) }
|
||||
it { expect(gestionnaire.followed_dossiers).not_to include(dossier) }
|
||||
end
|
||||
|
||||
describe '#unarchive' do
|
||||
|
|
Loading…
Reference in a new issue