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

Bug/58555 reminder mail not sent in case more than 15 notifications are to be reported about #17021

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/digest_mailer/work_packages.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<table <%= placeholder_table_styles %>>
<tr>
<td style="background: #D1E5F5; padding: 8px 12px; border: 1px solid #1A67A3; border-radius: 16px; overflow: hidden; text-overflow: ellipsis;">
<a href="<%= notifications_path %>"
<a href="<%= notifications_url %>"
target="_blank"
style="color: #1A67A3; text-decoration: none; font-size: 14px;white-space: nowrap;">
<%= I18n.t(:'mail.work_packages.see_all') %>
Expand Down
6 changes: 5 additions & 1 deletion app/workers/mails/reminder_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class Mails::ReminderJob < Mails::DeliverJob

good_job_control_concurrency_with(
total_limit: 1,
key: -> { "#{self.class.name}-#{arguments.last}" }
key: -> do
id = arguments.last.respond_to?(:id) ? arguments.last.id : arguments.last

"#{self.class.name}-#{id}"
end
)

private
Expand Down
10 changes: 10 additions & 0 deletions spec/mailers/digest_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@
.to have_text(expected_text, normalize_ws: true)
end

it "includes a reference to the notification center if there are more than the maximum number of shown work packages" do
stub_const("DigestMailer::MAX_SHOWN_WORK_PACKAGES", 0)

expect(mail_body)
.to have_text I18n.t(:"mail.work_packages.more_to_see.one")

expect(mail_body)
.to have_link(I18n.t(:"mail.work_packages.see_all"), href: notifications_url)
end

context "with only a deleted work package for the digest" do
let(:work_package) { nil }

Expand Down