summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-08-20 11:45:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-08-20 11:45:49 +0000
commite8afae7cbcd3b5bf00906eadecfa870e2bc5322d (patch)
tree194fc18e6a8c404ed19dd639f52172620e0441b2 /test/unit
parent7a450e1b84286d3fed81e6e89278f1667093b7a6 (diff)
downloadredmine-e8afae7cbcd3b5bf00906eadecfa870e2bc5322d.tar.gz
redmine-e8afae7cbcd3b5bf00906eadecfa870e2bc5322d.zip
Merged r15586 (#23172).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@15743 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/issue_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 3b7391a3c..f27fd1d1e 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -2292,6 +2292,19 @@ class IssueTest < ActiveSupport::TestCase
end
end
+ def test_assignable_users_should_not_include_users_that_cannot_view_the_tracker
+ user = User.find(3)
+ role = Role.find(2)
+ role.set_permission_trackers :view_issues, [1, 3]
+ role.save!
+
+ issue1 = Issue.new(:project_id => 1, :tracker_id => 1)
+ issue2 = Issue.new(:project_id => 1, :tracker_id => 2)
+
+ assert_include user, issue1.assignable_users
+ assert_not_include user, issue2.assignable_users
+ end
+
def test_create_should_send_email_notification
ActionMailer::Base.deliveries.clear
issue = Issue.new(:project_id => 1, :tracker_id => 1,