mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 13:30:28 +01:00
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@19998 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -73,7 +73,7 @@ module Redmine
|
|||||||
|
|
||||||
def notified_watchers
|
def notified_watchers
|
||||||
notified = watcher_users.active.to_a
|
notified = watcher_users.active.to_a
|
||||||
notified = notified.map {|n| n.is_a?(Group) ? n.users : n}.flatten
|
notified = notified.map {|n| n.is_a?(Group) ? n.users.active : n}.flatten
|
||||||
notified.uniq!
|
notified.uniq!
|
||||||
notified.reject! {|user| user.mail.blank? || user.mail_notification == 'none'}
|
notified.reject! {|user| user.mail.blank? || user.mail_notification == 'none'}
|
||||||
if respond_to?(:visible?)
|
if respond_to?(:visible?)
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ class MailerTest < ActiveSupport::TestCase
|
|||||||
:issue_statuses, :enumerations, :messages, :boards, :repositories,
|
:issue_statuses, :enumerations, :messages, :boards, :repositories,
|
||||||
:wikis, :wiki_pages, :wiki_contents, :wiki_content_versions,
|
:wikis, :wiki_pages, :wiki_contents, :wiki_content_versions,
|
||||||
:versions,
|
:versions,
|
||||||
:comments
|
:comments,
|
||||||
|
:groups_users, :watchers
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
ActionMailer::Base.deliveries.clear
|
ActionMailer::Base.deliveries.clear
|
||||||
@@ -602,6 +603,24 @@ class MailerTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_locked_user_in_group_watcher_should_not_be_notified
|
||||||
|
locked_user = users(:users_005)
|
||||||
|
group = Group.generate!
|
||||||
|
group.users << locked_user
|
||||||
|
issue = Issue.generate!
|
||||||
|
Watcher.create!(:watchable => issue, :user => group)
|
||||||
|
|
||||||
|
ActionMailer::Base.deliveries.clear
|
||||||
|
assert Mailer.deliver_issue_add(issue)
|
||||||
|
assert_not_include locked_user.mail, recipients
|
||||||
|
|
||||||
|
journal = issue.init_journal(User.current)
|
||||||
|
issue.update(:status_id => 4)
|
||||||
|
ActionMailer::Base.deliveries.clear
|
||||||
|
Mailer.deliver_issue_edit(journal)
|
||||||
|
assert_not_include locked_user.mail, recipients
|
||||||
|
end
|
||||||
|
|
||||||
def test_version_file_added
|
def test_version_file_added
|
||||||
attachements = [ Attachment.find_by_container_type('Version') ]
|
attachements = [ Attachment.find_by_container_type('Version') ]
|
||||||
assert Mailer.deliver_attachments_added(attachements)
|
assert Mailer.deliver_attachments_added(attachements)
|
||||||
|
|||||||
Reference in New Issue
Block a user