Skip to content

Commit

Permalink
Merge pull request #898 from MITLibraries/fix-pub-results-email
Browse files Browse the repository at this point in the history
Show count of preserved theses in publication results email
  • Loading branch information
jazairi authored Feb 10, 2022
2 parents a069d54 + 175a8f0 commit a3cf8b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/report_mailer/publication_results_email.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ul>
<li>Total theses in output queue: <%= @results[:total] %></li>
<li>Total theses updated: <%= @results[:processed] %></li>
<li>Total theses sent to preservation: <%= @results[:preservation_ready] %>
<li>Total theses sent to preservation: <%= @results[:preservation_ready].count %>
<li>Errors found: <%= @results[:errors].count %></li>
</ul>

Expand Down
4 changes: 3 additions & 1 deletion test/mailers/report_mailer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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&#39;t find Thesis with &#39;id&#39;=9999999999999', email.body.to_s
end
end
Expand Down

0 comments on commit a3cf8b7

Please sign in to comment.