generate export with export_template

This commit is contained in:
Christophe Robillard 2024-03-08 17:14:21 +01:00 committed by simon lehericey
parent 7a39752630
commit 357c07456c
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
17 changed files with 131 additions and 48 deletions

View file

@ -109,6 +109,14 @@ RSpec.describe Export, type: :model do
end
end
context 'with export template' do
let(:export_template) { build(:export_template) }
it 'creates new export' do
expect { Export.find_or_create_fresh_export(:zip, [gi_1], instructeur, export_template: export_template, time_span_type: Export.time_span_types.fetch(:everything), statut: Export.statuts.fetch(:tous), procedure_presentation: pp) }
.to change { Export.count }.by(1)
end
end
context 'with existing matching export' do
def find_or_create =
Export.find_or_create_fresh_export(:zip, [gi_1], instructeur, time_span_type: Export.time_span_types.fetch(:everything), statut: Export.statuts.fetch(:tous), procedure_presentation: pp)