@@ -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 = |
|
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 = |
|
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,7 +58,8 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 |
|
61 | notified.reject! {|user| user.mail_notification == 'none'} | ||
|
62 | ||||
62 | if respond_to?(:visible?) |
|
63 | if respond_to?(:visible?) | |
63 | notified.reject! {|user| !visible?(user)} |
|
64 | notified.reject! {|user| !visible?(user)} | |
64 | end |
|
65 | end |
General Comments 0
You need to be logged in to leave comments.
Login now