Fix reopened dossier should not be listed in new dossiers

This commit is contained in:
Mathieu Magnin 2017-03-06 15:59:52 +01:00
parent 63a7b91e60
commit 44819bb0b1
2 changed files with 4 additions and 4 deletions

View file

@ -168,11 +168,11 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
end
redirect_to backoffice_dossier_path(@dossier)
end
def reopen
create_dossier_facade params[:dossier_id]
@facade.dossier.initiated!
@facade.dossier.replied!
flash.notice = 'Dossier réouvert.'
redirect_to backoffice_dossiers_path

View file

@ -362,11 +362,11 @@ describe Backoffice::DossiersController, type: :controller do
subject { post :reopen, params: {dossier_id: dossier_id} }
it 'change state to initiated' do
it 'change state to replied' do
subject
dossier.reload
expect(dossier.state).to eq('initiated')
expect(dossier.state).to eq('replied')
end
it { is_expected.to redirect_to backoffice_dossiers_path }