Merge pull request #11355 from opf/fix-watcher_mailer

[Fix] Error on Mails::WatcherJob missing notification_settings
pull/11360/head
ulferts 2 years ago committed by GitHub
commit f8e7da5425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/workers/mails/watcher_job.rb
  2. 7
      spec/workers/mails/shared/watcher_job.rb

@ -61,6 +61,8 @@ class Mails::WatcherJob < Mails::DeliverJob
.applicable(watcher.watchable.project)
.first
return false if settings.nil?
settings.watched
end

@ -147,4 +147,11 @@ shared_examples "watcher job" do |action|
[build_stubbed(:notification_setting, mentioned: true, involved: false, watched: false)]
end
end
it_behaves_like 'does not notify the watcher' do
# Regression test for notification settings being empty
let(:notification_settings) do
[]
end
end
end

Loading…
Cancel
Save