##// END OF EJS Templates
Fixed: Email notifications are sent to watchers even if 'No events' setting is chosen (#7763)....
Jean-Philippe Lang -
r4884:8fb446e87fa5
parent child
Show More
@@ -60,15 +60,15 class WatcherTest < ActiveSupport::TestCase
60 assert @issue.watcher_recipients.empty?
60 assert @issue.watcher_recipients.empty?
61 assert @issue.add_watcher(@user)
61 assert @issue.add_watcher(@user)
62
62
63 @user.mail_notification = true
63 @user.mail_notification = 'all'
64 @user.save
64 @user.save!
65 @issue.reload
65 @issue.reload
66 assert @issue.watcher_recipients.include?(@user.mail)
66 assert @issue.watcher_recipients.include?(@user.mail)
67
67
68 @user.mail_notification = false
68 @user.mail_notification = 'none'
69 @user.save
69 @user.save!
70 @issue.reload
70 @issue.reload
71 assert @issue.watcher_recipients.include?(@user.mail)
71 assert !@issue.watcher_recipients.include?(@user.mail)
72 end
72 end
73
73
74 def test_unwatch
74 def test_unwatch
@@ -58,6 +58,7 module Redmine
58 # Returns an array of watchers' email addresses
58 # Returns an array of watchers' email addresses
59 def watcher_recipients
59 def watcher_recipients
60 notified = watcher_users.active
60 notified = watcher_users.active
61 notified.reject! {|user| user.mail_notification == 'none'}
61
62
62 if respond_to?(:visible?)
63 if respond_to?(:visible?)
63 notified.reject! {|user| !visible?(user)}
64 notified.reject! {|user| !visible?(user)}
General Comments 0
You need to be logged in to leave comments. Login now