dossier: make Dossiers#show a stub redirecting to the correct location

This commit is contained in:
Pierre de La Morinerie 2018-08-07 09:58:10 +00:00
parent f37a628b44
commit 0ac28da207
3 changed files with 26 additions and 3 deletions

View file

@ -478,6 +478,21 @@ describe NewUser::DossiersController, type: :controller do
end
end
describe '#show' do
before { sign_in(user) }
subject! { get(:show, params: { id: dossier.id }) }
context 'when the dossier is a brouillon' do
let(:dossier) { create(:dossier, user: user) }
it { is_expected.to redirect_to(modifier_dossier_path(dossier)) }
end
context 'when the dossier has been submitted' do
let(:dossier) { create(:dossier, :en_construction, user: user) }
it { is_expected.to redirect_to(users_dossier_recapitulatif_path(dossier)) }
end
end
describe '#ask_deletion' do
before { sign_in(user) }