fix DoubleRender error for brouillon pdf
This commit is contained in:
parent
5bd4c16de8
commit
1c3573c7db
2 changed files with 10 additions and 3 deletions
|
@ -33,6 +33,7 @@ module Users
|
||||||
def show
|
def show
|
||||||
if dossier.brouillon?
|
if dossier.brouillon?
|
||||||
redirect_to brouillon_dossier_path(dossier)
|
redirect_to brouillon_dossier_path(dossier)
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@dossier = dossier
|
@dossier = dossier
|
||||||
|
|
|
@ -757,13 +757,19 @@ describe Users::DossiersController, type: :controller do
|
||||||
procedure: procedure,
|
procedure: procedure,
|
||||||
user: user)
|
user: user)
|
||||||
}
|
}
|
||||||
|
|
||||||
subject! { get(:show, params: { id: dossier.id, format: :pdf }) }
|
subject! { get(:show, params: { id: dossier.id, format: :pdf }) }
|
||||||
|
|
||||||
|
context 'when the dossier is a brouillon' do
|
||||||
|
let(:dossier) { create(:dossier, user: user) }
|
||||||
|
it { is_expected.to redirect_to(brouillon_dossier_path(dossier)) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when the dossier has been submitted' do
|
||||||
it { expect(assigns(:include_infos_administration)).to eq(false) }
|
it { expect(assigns(:include_infos_administration)).to eq(false) }
|
||||||
it { expect(response).to render_template 'dossiers/show' }
|
it { expect(response).to render_template 'dossiers/show' }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe '#formulaire' do
|
describe '#formulaire' do
|
||||||
let(:dossier) { create(:dossier, :en_construction, user: user) }
|
let(:dossier) { create(:dossier, :en_construction, user: user) }
|
||||||
|
|
Loading…
Reference in a new issue