Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show count of preserved theses in publication results email #898

Merged
merged 1 commit into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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