summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-03 21:28:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-03 21:28:14 +0000
commitc870a7b9ef35ed457911638b7a98e7681cfe6d3a (patch)
treea69a9318685afe9a3c46e7f0ea20b9356e135df7 /test/unit/issue_test.rb
parent8bc0f7888bdddf452bbaa97c86e22b6ebc0aac58 (diff)
downloadredmine-c870a7b9ef35ed457911638b7a98e7681cfe6d3a.tar.gz
redmine-c870a7b9ef35ed457911638b7a98e7681cfe6d3a.zip
Do not notify users that are no longer allowed to view an issue (#3589, #4263).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3121 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r--test/unit/issue_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index afde6c720..bd37f9880 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -353,6 +353,23 @@ class IssueTest < ActiveSupport::TestCase
assert_nil copy.custom_value_for(2)
end
+ def test_recipients_should_not_include_users_that_cannot_view_the_issue
+ issue = Issue.find(12)
+ assert issue.recipients.include?(issue.author.mail)
+ # move the issue to a private project
+ copy = issue.move_to(Project.find(5), Tracker.find(2), :copy => true)
+ # author is not a member of project anymore
+ assert !copy.recipients.include?(copy.author.mail)
+ end
+
+ def test_watcher_recipients_should_not_include_users_that_cannot_view_the_issue
+ user = User.find(3)
+ issue = Issue.find(9)
+ Watcher.create!(:user => user, :watchable => issue)
+ assert issue.watched_by?(user)
+ assert !issue.watcher_recipients.include?(user.mail)
+ end
+
def test_issue_destroy
Issue.find(1).destroy
assert_nil Issue.find_by_id(1)