From a3c5bf58ac245258413a4c08658a3d81c5960727 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 21 Apr 2022 15:34:24 +0200 Subject: [PATCH] bug(ProcedureExportService.to_zip): use in_batches on Array --- .../services/procedure_export_service_spec.rb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/spec/services/procedure_export_service_spec.rb b/spec/services/procedure_export_service_spec.rb index 1021691b6..d85185d2a 100644 --- a/spec/services/procedure_export_service_spec.rb +++ b/spec/services/procedure_export_service_spec.rb @@ -1,10 +1,12 @@ require 'csv' 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 - ProcedureExportService.new(procedure, procedure.dossiers) + service .to_xlsx .open { |f| SimpleXlsxReader.open(f.path) } end @@ -406,4 +408,15 @@ describe ProcedureExportService do 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