From 175a8f05267c07b6249f75af9bcaeb82874bbd53 Mon Sep 17 00:00:00 2001 From: Adam Jazairi Date: Wed, 9 Feb 2022 16:02:46 -0500 Subject: [PATCH] Show count of preserved theses in publication results email Why these changes are being introduced: The publication results email shows the full array of preserved thesis. It should show the total count instead. Relevant ticket(s): N/A. How this addresses that need: This changes the publication results email view to render the count of preserved theses. Side effects of this change: None. --- app/views/report_mailer/publication_results_email.html.erb | 2 +- test/mailers/report_mailer_test.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/report_mailer/publication_results_email.html.erb b/app/views/report_mailer/publication_results_email.html.erb index b7100269..19bd4016 100644 --- a/app/views/report_mailer/publication_results_email.html.erb +++ b/app/views/report_mailer/publication_results_email.html.erb @@ -7,7 +7,7 @@ diff --git a/test/mailers/report_mailer_test.rb b/test/mailers/report_mailer_test.rb index 6b8bda79..1d76eb31 100644 --- a/test/mailers/report_mailer_test.rb +++ b/test/mailers/report_mailer_test.rb @@ -24,7 +24,8 @@ class ReportMailerTest < ActionMailer::TestCase test 'sends reports for DSpace publication results' do ClimateControl.modify DISABLE_ALL_EMAIL: 'false' do - results = { total: 2, processed: 1, errors: ["Couldn't find Thesis with 'id'=9999999999999"] } + results = { total: 2, processed: 1, errors: ["Couldn't find Thesis with 'id'=9999999999999"], + preservation_ready: [] } email = ReportMailer.publication_results_email(results) assert_emails 1 do @@ -37,6 +38,7 @@ class ReportMailerTest < ActionMailer::TestCase assert_match 'Total theses in output queue: 2', email.body.to_s assert_match 'Total theses updated: 1', email.body.to_s assert_match 'Errors found: 1', email.body.to_s + assert_match 'Total theses sent to preservation: 0', email.body.to_s assert_match 'Couldn't find Thesis with 'id'=9999999999999', email.body.to_s end end