Browse Source

Call export_xml_lettings_logs with nil if no year is given

pull/1875/head
Kat 3 years ago
parent
commit
9ec5ad5614
  1. 2
      lib/tasks/data_export.rake
  2. 2
      spec/lib/tasks/data_export_spec.rb

2
lib/tasks/data_export.rake

@ -13,7 +13,7 @@ namespace :core do
desc "Export all data XMLs for import into Central Data System (CDS)" desc "Export all data XMLs for import into Central Data System (CDS)"
task :full_data_export_xml, %i[year] => :environment do |_task, args| 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"]) 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) export_service = Exports::LettingsLogExportService.new(storage_service)

2
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 context "with all available years" do
it "calls the export service" 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 task.invoke
end end

Loading…
Cancel
Save