Avis: instruction

This commit is contained in:
Simon Lehericey 2017-09-06 16:14:03 +02:00
parent a1f9f7aa75
commit 88c27479ee
6 changed files with 102 additions and 1 deletions

View file

@ -34,4 +34,23 @@ describe NewGestionnaire::AvisController, type: :controller do
it { expect(assigns(:avis)).to eq(avis_without_answer) }
it { expect(assigns(:dossier)).to eq(dossier) }
end
describe '#instruction' do
before { get :instruction, { id: avis_without_answer.id } }
it { expect(response).to have_http_status(:success) }
it { expect(assigns(:avis)).to eq(avis_without_answer) }
it { expect(assigns(:dossier)).to eq(dossier) }
end
describe '#update' do
before do
patch :update, { id: avis_without_answer.id, avis: { answer: 'answer' } }
avis_without_answer.reload
end
it { expect(response).to redirect_to(instruction_avis_path(avis_without_answer)) }
it { expect(avis_without_answer.answer).to eq('answer') }
it { expect(flash.notice).to eq('Votre réponse est enregistrée.') }
end
end