DossierControllerSpec: refactor
This commit is contained in:
parent
97de5b2dd9
commit
d5535aaaaa
1 changed files with 5 additions and 19 deletions
|
@ -224,27 +224,13 @@ describe Backoffice::DossiersController, type: :controller do
|
||||||
before do
|
before do
|
||||||
dossier.initiated!
|
dossier.initiated!
|
||||||
sign_in gestionnaire
|
sign_in gestionnaire
|
||||||
|
post :receive, params: { dossier_id: dossier_id }
|
||||||
|
dossier.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
subject { post :receive, params: {dossier_id: dossier_id} }
|
it { expect(dossier.state).to eq('received') }
|
||||||
|
it { is_expected.to redirect_to backoffice_dossier_path(dossier) }
|
||||||
context 'when it post a receive instruction' do
|
it { expect(gestionnaire.follow?(dossier)).to be true }
|
||||||
before do
|
|
||||||
subject
|
|
||||||
dossier.reload
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'change state to received' do
|
|
||||||
expect(dossier.state).to eq('received')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue