NewDossierController: add next_step follow
This commit is contained in:
parent
8b2366cb98
commit
6cff044a50
2 changed files with 5 additions and 1 deletions
|
@ -10,6 +10,7 @@ module NewGestionnaire
|
|||
|
||||
def follow
|
||||
current_gestionnaire.follow(dossier)
|
||||
dossier.next_step!('gestionnaire', 'follow')
|
||||
redirect_back(fallback_location: procedures_url)
|
||||
end
|
||||
|
||||
|
|
|
@ -32,7 +32,10 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
|||
before { sign_in(gestionnaire) }
|
||||
|
||||
describe 'follow' do
|
||||
before { patch :follow, params: { procedure_id: procedure.id, dossier_id: dossier.id } }
|
||||
before do
|
||||
expect_any_instance_of(Dossier).to receive(:next_step!).with('gestionnaire', 'follow')
|
||||
patch :follow, params: { procedure_id: procedure.id, dossier_id: dossier.id }
|
||||
end
|
||||
|
||||
it { expect(gestionnaire.followed_dossiers).to match([dossier]) }
|
||||
it { expect(response).to redirect_to(procedures_url) }
|
||||
|
|
Loading…
Reference in a new issue