BackofficeDossierController: follow dossier when receive

This commit is contained in:
Simon Lehericey 2017-07-17 11:28:52 +02:00 committed by Mathieu Magnin
parent b80d6a6a59
commit 86ea47bb0d
2 changed files with 6 additions and 0 deletions

View file

@ -98,6 +98,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
dossier = Dossier.find(params[:dossier_id]) dossier = Dossier.find(params[:dossier_id])
dossier.received! dossier.received!
current_gestionnaire.follow(dossier)
flash.notice = 'Dossier considéré comme reçu.' flash.notice = 'Dossier considéré comme reçu.'
redirect_to backoffice_dossier_path(id: dossier.id) redirect_to backoffice_dossier_path(id: dossier.id)

View file

@ -248,6 +248,11 @@ describe Backoffice::DossiersController, type: :controller do
end end
it { is_expected.to redirect_to backoffice_dossier_path(id: dossier.id) } it { is_expected.to redirect_to backoffice_dossier_path(id: dossier.id) }
it do
subject
expect(gestionnaire.follow?(dossier)).to be true
end
end end
describe 'POST #process_dossier' do describe 'POST #process_dossier' do