Add and use DossiersController#passer_en_instruction

This commit is contained in:
gregoirenovel 2017-11-30 17:11:46 +01:00
parent 56ba310e89
commit eb55dfc0c8
4 changed files with 23 additions and 1 deletions

View file

@ -77,6 +77,19 @@ describe NewGestionnaire::DossiersController, type: :controller do
it { expect(response).to redirect_to(procedures_url) }
end
describe '#passer_en_instruction' do
before do
dossier.initiated!
sign_in gestionnaire
post :passer_en_instruction, params: { procedure_id: procedure.id, dossier_id: dossier.id }
dossier.reload
end
it { expect(dossier.state).to eq('received') }
it { is_expected.to redirect_to dossier_path(procedure, dossier) }
it { expect(gestionnaire.follow?(dossier)).to be true }
end
describe '#show #messagerie #annotations_privees #avis' do
before do
dossier.notifications = %w(champs annotations_privees avis commentaire).map{ |type| Notification.create!(type_notif: type) }