generate export with export_template
This commit is contained in:
parent
7a39752630
commit
357c07456c
17 changed files with 131 additions and 48 deletions
|
@ -936,7 +936,7 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
subject
|
||||
end
|
||||
|
||||
it { expect(assigns(:acls)).to eq(PiecesJustificativesService.new(user_profile: instructeur).acl_for_dossier_export(dossier.procedure)) }
|
||||
it { expect(assigns(:acls)).to eq(PiecesJustificativesService.new(user_profile: instructeur, export_template: nil).acl_for_dossier_export(dossier.procedure)) }
|
||||
it { expect(assigns(:is_dossier_in_batch_operation)).to eq(false) }
|
||||
it { expect(response).to render_template 'dossiers/show' }
|
||||
|
||||
|
|
|
@ -736,6 +736,18 @@ describe Instructeurs::ProceduresController, type: :controller do
|
|||
end
|
||||
|
||||
it { expect { subject }.to change { Export.where(user_profile: instructeur).count }.by(1) }
|
||||
|
||||
context 'with an export template' do
|
||||
let(:export_template) { create(:export_template) }
|
||||
subject do
|
||||
get :download_export, params: { export_template_id: export_template.id, procedure_id: procedure.id }
|
||||
end
|
||||
|
||||
it 'displays an notice' do
|
||||
is_expected.to redirect_to(exports_instructeur_procedure_url(procedure))
|
||||
expect(flash.notice).to be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the export is not ready' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue