Browse Source

update suffixes

pull/1818/head
Kat 3 years ago
parent
commit
78e1555f95
  1. 4
      app/services/imports/import_report_service.rb
  2. 8
      spec/services/imports/import_report_service_spec.rb

4
app/services/imports/import_report_service.rb

@ -22,7 +22,7 @@ module Imports
end
end
report_name = "OrganisationsWithoutDataCoordinators_#{report_suffix}.csv"
report_name = "OrganisationsWithoutDataCoordinators_#{report_suffix}"
@storage_service.write_file(report_name, BYTE_ORDER_MARK + report_csv)
@logger.info("Missing data coordinators report available in s3 import bucket at #{report_name}")
@ -48,7 +48,7 @@ module Imports
end
end
report_name = "MigratedLogsReport_#{report_suffix}.csv"
report_name = "MigratedLogsReport_#{report_suffix}"
@storage_service.write_file(report_name, BYTE_ORDER_MARK + rep)
@logger.info("Logs report available in s3 import bucket at #{report_name}")

8
spec/services/imports/import_report_service_spec.rb

@ -17,7 +17,7 @@ RSpec.describe Imports::ImportReportService do
it "writes an empty organisations without a data coordinators report" do
expect(storage_service).to receive(:write_file).with("OrganisationsWithoutDataCoordinators_report_suffix.csv", "\uFEFFOrganisation ID,Old Organisation ID,Organisation Name\n")
report_service.generate_missing_data_coordinators_report("report_suffix")
report_service.generate_missing_data_coordinators_report("report_suffix.csv")
end
end
@ -34,7 +34,7 @@ RSpec.describe Imports::ImportReportService do
it "writes an empty organisations without a data coordinators report" do
expect(storage_service).to receive(:write_file).with("OrganisationsWithoutDataCoordinators_report_suffix.csv", "\uFEFFOrganisation ID,Old Organisation ID,Organisation Name\n#{organisation2.id},2,org2\n#{organisation3.id},3,org3\n")
report_service.generate_missing_data_coordinators_report("report_suffix")
report_service.generate_missing_data_coordinators_report("report_suffix.csv")
end
end
@ -49,7 +49,7 @@ RSpec.describe Imports::ImportReportService do
it "includes that organisation in the data coordinators report" do
expect(storage_service).to receive(:write_file).with("OrganisationsWithoutDataCoordinators_report_suffix.csv", "\uFEFFOrganisation ID,Old Organisation ID,Organisation Name\n#{organisation.id},1,org1\n")
report_service.generate_missing_data_coordinators_report("report_suffix")
report_service.generate_missing_data_coordinators_report("report_suffix.csv")
end
end
end
@ -64,7 +64,7 @@ RSpec.describe Imports::ImportReportService do
it "generates a report with imported logs" do
expect(storage_service).to receive(:write_file).with("MigratedLogsReport_report_suffix.csv", "\uFEFFInstitution name,Id,Old Completed lettings logs,Old In progress lettings logs,Old Completed sales logs,Old In progress sales logs,New Completed lettings logs,New In Progress lettings logs,New Completed sales logs,New In Progress sales logs\norg1,1,2,1,4,3,0,0,0,0\norg2,2,5,6,5,7,0,0,0,0\n")
report_service.generate_logs_report("report_suffix")
report_service.generate_logs_report("report_suffix.csv")
end
end
end

Loading…
Cancel
Save