From 9ec5ad5614cb3af1df500881ca7f6e813b0a4bbf Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 30 Aug 2023 11:04:22 +0200 Subject: [PATCH] Call export_xml_lettings_logs with nil if no year is given --- lib/tasks/data_export.rake | 2 +- spec/lib/tasks/data_export_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/data_export.rake b/lib/tasks/data_export.rake index 940799bd1..20a383772 100644 --- a/lib/tasks/data_export.rake +++ b/lib/tasks/data_export.rake @@ -13,7 +13,7 @@ namespace :core do desc "Export all data XMLs for import into Central Data System (CDS)" task :full_data_export_xml, %i[year] => :environment do |_task, args| - collection_year = args[:year].presence || false + collection_year = args[:year].presence storage_service = Storage::S3Service.new(PlatformHelper.is_paas? ? Configuration::PaasConfigurationService.new : Configuration::EnvConfigurationService.new, ENV["EXPORT_PAAS_INSTANCE"]) export_service = Exports::LettingsLogExportService.new(storage_service) diff --git a/spec/lib/tasks/data_export_spec.rb b/spec/lib/tasks/data_export_spec.rb index 9bb246863..bb407edd2 100644 --- a/spec/lib/tasks/data_export_spec.rb +++ b/spec/lib/tasks/data_export_spec.rb @@ -32,7 +32,7 @@ describe "rake core:data_export", type: task do context "with all available years" do it "calls the export service" do - expect(export_service).to receive(:export_xml_lettings_logs).with(full_update: true, collection_year: false) + expect(export_service).to receive(:export_xml_lettings_logs).with(full_update: true, collection_year: nil) task.invoke end