From 4cf250d126fae1215c97194043306ed9ed4a3824 Mon Sep 17 00:00:00 2001 From: Ben Pennell Date: Mon, 14 Oct 2024 09:13:41 -0400 Subject: [PATCH] Boolean name fixes and ruby 3 param adjustment in test --- spec/jobs/attach_files_to_work_job_spec.rb | 2 +- spec/mailers/dimensions_report_mailer_spec.rb | 4 ++-- spec/mailers/previews/dimensions_report_mailer_preview.rb | 2 +- spec/services/tasks/dimensions_reporting_service_spec.rb | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/jobs/attach_files_to_work_job_spec.rb b/spec/jobs/attach_files_to_work_job_spec.rb index 98ac5046b..d23737bc6 100644 --- a/spec/jobs/attach_files_to_work_job_spec.rb +++ b/spec/jobs/attach_files_to_work_job_spec.rb @@ -56,7 +56,7 @@ context 'with safe file' do it 'succeeds without any reporting' do # Catch expected call to wrapped implementation of perform - expect(subject).to receive(:original_perform).with(work, [uploaded_file], {}) + expect(subject).to receive(:original_perform).with(work, [uploaded_file]) expect(Hyc::VirusScanner).to receive(:hyc_infected?).and_return(ClamAV::SuccessResponse.new(target_file)) subject.perform(work, [uploaded_file]) end diff --git a/spec/mailers/dimensions_report_mailer_spec.rb b/spec/mailers/dimensions_report_mailer_spec.rb index d474ae317..bc3dc8abc 100644 --- a/spec/mailers/dimensions_report_mailer_spec.rb +++ b/spec/mailers/dimensions_report_mailer_spec.rb @@ -51,7 +51,7 @@ let(:ingested_publications) do ingest_service.ingest_publications(test_publications) end - let(:report) { Tasks::DimensionsReportingService.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, FALSE).generate_report } + let(:report) { Tasks::DimensionsReportingService.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, false).generate_report } before do ActiveFedora::Cleaner.clean! @@ -109,7 +109,7 @@ end it 'renders a different message for manually executed ingest' do - service = Tasks::DimensionsReportingService.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, FALSE) + service = Tasks::DimensionsReportingService.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, false) report = service.generate_report mail = DimensionsReportMailer.dimensions_report_email(report) expect(mail.body.encoded).to include('Reporting publications from manually executed Dimensions ingest') diff --git a/spec/mailers/previews/dimensions_report_mailer_preview.rb b/spec/mailers/previews/dimensions_report_mailer_preview.rb index 543fe74e2..537939f41 100644 --- a/spec/mailers/previews/dimensions_report_mailer_preview.rb +++ b/spec/mailers/previews/dimensions_report_mailer_preview.rb @@ -46,7 +46,7 @@ def dimensions_report_email end end - dimensions_reporting_service = Tasks::DimensionsReportingService.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, FALSE) + dimensions_reporting_service = Tasks::DimensionsReportingService.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, false) report = dimensions_reporting_service.generate_report DimensionsReportMailer.dimensions_report_email(report) end diff --git a/spec/services/tasks/dimensions_reporting_service_spec.rb b/spec/services/tasks/dimensions_reporting_service_spec.rb index 4e47172f7..b8dc6f3f5 100644 --- a/spec/services/tasks/dimensions_reporting_service_spec.rb +++ b/spec/services/tasks/dimensions_reporting_service_spec.rb @@ -80,7 +80,7 @@ describe '#generate_report' do it 'generates a report for ingest dimensions publications' do - service = described_class.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, TRUE) + service = described_class.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, true) report = service.generate_report headers = report[:headers] expect(report[:subject]).to eq('Dimensions Ingest Report for May 21, 2024 at 10:00 AM UTC') @@ -93,7 +93,7 @@ end it 'provides a different message for manually executed ingest' do - service = described_class.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, FALSE) + service = described_class.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, false) report = service.generate_report headers = report[:headers] expect(headers[:reporting_message]).to eq('Reporting publications from manually executed Dimensions ingest on May 21, 2024 at 10:00 AM UTC by admin.') @@ -120,7 +120,7 @@ def expect_publication_info(info_array, sample_array, failed, sample_start_index end it 'extracts publication information for the report' do - service = described_class.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, TRUE) + service = described_class.new(ingested_publications, FIXED_DIMENSIONS_TOTAL_COUNT, { start_date: TEST_START_DATE, end_date: TEST_END_DATE }, true) extracted_info = service.extract_publication_info expect(extracted_info[:successfully_ingested].length).to eq(8) expect(extracted_info[:failed_to_ingest].length).to eq(3)