diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/issues.yml | 2 | ||||
-rw-r--r-- | test/unit/issue_test.rb | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/test/fixtures/issues.yml b/test/fixtures/issues.yml index 03197458d..a6a5be3a7 100644 --- a/test/fixtures/issues.yml +++ b/test/fixtures/issues.yml @@ -185,7 +185,7 @@ issues_012: description: tracker_id: 1 assigned_to_id: - author_id: 2 + author_id: 3 status_id: 5 start_date: <%= 1.day.ago.to_date.to_s(:db) %> due_date: 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) |