bug(ProcedureExportService.to_zip): use in_batches on Array

This commit is contained in:
Martin 2022-04-21 15:34:24 +02:00 committed by mfo
parent 196725346b
commit a3c5bf58ac

View file

@ -1,10 +1,12 @@
require 'csv' require 'csv'
describe ProcedureExportService do describe ProcedureExportService do
describe 'to_data' do let(:procedure) { create(:procedure, :published, :for_individual, :with_all_champs) }
let(:procedure) { create(:procedure, :published, :for_individual, :with_all_champs) } let(:service) { ProcedureExportService.new(procedure, procedure.dossiers) }
describe 'to_xlsx' do
subject do subject do
ProcedureExportService.new(procedure, procedure.dossiers) service
.to_xlsx .to_xlsx
.open { |f| SimpleXlsxReader.open(f.path) } .open { |f| SimpleXlsxReader.open(f.path) }
end end
@ -406,4 +408,15 @@ describe ProcedureExportService do
end end
end end
end end
describe 'to_zip' do
subject do
service
.to_zip
end
it 'does not raises in_batches' do
expect(subject).not_to raise_error(NoMethodError)
end
end
end end