diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-06-28 20:31:08 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-06-28 20:31:08 +0000 |
commit | 83777f727a4291e63962470070b9a1bba9e42f27 (patch) | |
tree | 2dc9305021575ba4ae2e8c3d513552d2f29b56f0 /test/unit | |
parent | b6982e755b52b6b448001d4d55fdb71550af84a7 (diff) | |
download | redmine-83777f727a4291e63962470070b9a1bba9e42f27.tar.gz redmine-83777f727a4291e63962470070b9a1bba9e42f27.zip |
Assignable users should not include users that cannot view the tracker (#23172).
git-svn-id: http://svn.redmine.org/redmine/trunk@15586 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/issue_test.rb | 13 |
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, |