Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove all option in watcher job spec

Oliver Günther5e8d9867c1ea
diff --git a/app/workers/mails/watcher_job.rb b/app/workers/mails/watcher_job.rb
index 3d1927f4185..545f8469af6 100644
--- a/app/workers/mails/watcher_job.rb
+++ b/app/workers/mails/watcher_job.rb
@@ -61,10 +61,9 @@ class Mails::WatcherJob < Mails::DeliverJob
.user
.notification_settings
.applicable(watcher.watchable.project)
- .mail
.first
- settings.watched || settings.all
+ settings.watched
end
def self_watching?
diff --git a/spec/workers/mails/shared/watcher_job.rb b/spec/workers/mails/shared/watcher_job.rb
index 7eac88f49fd..30d2aff1df4 100644
--- a/spec/workers/mails/shared/watcher_job.rb
+++ b/spec/workers/mails/shared/watcher_job.rb
@@ -46,7 +46,7 @@ shared_examples "watcher job" do |action|
FactoryBot.build_stubbed(:user_preference)
end
let(:notification_settings) do
- [FactoryBot.build_stubbed(:notification_setting, all: true)]
+ [FactoryBot.build_stubbed(:notification_setting)]
end
let(:watching_user) do
FactoryBot.build_stubbed(:user,
@@ -58,10 +58,6 @@ shared_examples "watcher job" do |action|
allow(notification_settings)
.to receive(:applicable)
.and_return(notification_settings)
-
- allow(notification_settings)
- .to receive(:mail)
- .and_return(notification_settings)
end
end
@@ -132,7 +128,7 @@ shared_examples "watcher job" do |action|
it_behaves_like 'notifies the watcher' do
let(:notification_settings) do
- [FactoryBot.build_stubbed(:notification_setting, mentioned: false, involved: false, watched: false, all: true)]
+ [FactoryBot.build_stubbed(:notification_setting, mentioned: false, involved: false, watched: true)]
end
end