Skip to content

Commit

Permalink
Boolean name fixes and ruby 3 param adjustment in test
Browse files Browse the repository at this point in the history
  • Loading branch information
bbpennel committed Oct 14, 2024
1 parent 6386d10 commit 4cf250d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion spec/jobs/attach_files_to_work_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/mailers/dimensions_report_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion spec/mailers/previews/dimensions_report_mailer_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/services/tasks/dimensions_reporting_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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.')
Expand All @@ -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)
Expand Down

0 comments on commit 4cf250d

Please sign in to comment.