Merged r5004 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.1-stable@5012 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-03-06 12:48:40 +00:00
parent c45044f13c
commit 4d0a955d3c
2 changed files with 7 additions and 6 deletions

View File

@ -60,15 +60,15 @@ class WatcherTest < ActiveSupport::TestCase
assert @issue.watcher_recipients.empty?
assert @issue.add_watcher(@user)
@user.mail_notification = true
@user.save
@user.mail_notification = 'all'
@user.save!
@issue.reload
assert @issue.watcher_recipients.include?(@user.mail)
@user.mail_notification = false
@user.save
@user.mail_notification = 'none'
@user.save!
@issue.reload
assert @issue.watcher_recipients.include?(@user.mail)
assert !@issue.watcher_recipients.include?(@user.mail)
end
def test_unwatch

View File

@ -58,7 +58,8 @@ module Redmine
# Returns an array of watchers' email addresses
def watcher_recipients
notified = watcher_users.active
notified.reject! {|user| user.mail_notification == 'none'}
if respond_to?(:visible?)
notified.reject! {|user| !visible?(user)}
end