Commit dac912b3 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang Committed by Eric Davis

Fixed: Email notifications are sent to watchers even if 'No events' setting is chosen (#7763).

git-svn-id: svn+ssh:// e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 6f5707c2
......@@ -60,15 +60,15 @@ class WatcherTest < ActiveSupport::TestCase
assert @issue.watcher_recipients.empty?
assert @issue.add_watcher(@user)
@user.mail_notification = true
@user.mail_notification = 'all'!
assert @issue.watcher_recipients.include?(@user.mail)
@user.mail_notification = false
@user.mail_notification = 'none'!
assert @issue.watcher_recipients.include?(@user.mail)
assert !@issue.watcher_recipients.include?(@user.mail)
def test_unwatch
......@@ -58,7 +58,8 @@ module Redmine
# Returns an array of watchers' email addresses
def watcher_recipients
notified =
notified.reject! {|user| user.mail_notification == 'none'}
if respond_to?(:visible?)
notified.reject! {|user| !visible?(user)}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment