summaryrefslogtreecommitdiffstats
path: root/test/unit/mailer_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-05 15:49:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-05 15:49:07 +0000
commitc8b722456c5d73e0a85c2073cd3fd7cd5c35a29c (patch)
tree748bf3cba8c73eca77b5ceffbe1b33f117def0e1 /test/unit/mailer_test.rb
parent7f3cc6e38b873d5f56b411872ddcd3570223b7ad (diff)
downloadredmine-c8b722456c5d73e0a85c2073cd3fd7cd5c35a29c.tar.gz
redmine-c8b722456c5d73e0a85c2073cd3fd7cd5c35a29c.zip
Fixed that watchers receive notifications for private comments without permission (#12286).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10789 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mailer_test.rb')
-rw-r--r--test/unit/mailer_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb
index 8d65cc5b7..a92f738a7 100644
--- a/test/unit/mailer_test.rb
+++ b/test/unit/mailer_test.rb
@@ -350,6 +350,21 @@ class MailerTest < ActiveSupport::TestCase
assert_equal %w(jsmith@somenet.foo), ActionMailer::Base.deliveries.last.bcc.sort
end
+ def test_issue_edit_should_send_private_notes_to_watchers_with_permission_only
+ Issue.find(1).set_watcher(User.find_by_login('someone'))
+ journal = Journal.find(1)
+ journal.private_notes = true
+ journal.save!
+
+ Role.non_member.add_permission! :view_private_notes
+ Mailer.issue_edit(journal).deliver
+ assert_include 'someone@foo.bar', ActionMailer::Base.deliveries.last.bcc.sort
+
+ Role.non_member.remove_permission! :view_private_notes
+ Mailer.issue_edit(journal).deliver
+ assert_not_include 'someone@foo.bar', ActionMailer::Base.deliveries.last.bcc.sort
+ end
+
def test_document_added
document = Document.find(1)
valid_languages.each do |lang|