summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-07-25 08:54:25 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-07-25 08:54:25 +0000
commitbffee57744190c039125743342851955a9a0459f (patch)
tree981d0ee56319b542657dc5092541757c9c2c182e /test
parent64354aa68810c0d9c0391ef3aad3db469127ba5d (diff)
downloadredmine-bffee57744190c039125743342851955a9a0459f.tar.gz
redmine-bffee57744190c039125743342851955a9a0459f.zip
Merged r14450 (#20206).
git-svn-id: http://svn.redmine.org/redmine/branches/3.1-stable@14453 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/issue_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index bf4d49492..9a8afd66d 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -310,6 +310,15 @@ class IssueTest < ActiveSupport::TestCase
assert_visibility_match user, issues
end
+ def test_visible_scope_for_member_without_view_issues_permission_and_non_member_role_having_the_permission
+ Role.non_member.add_permission!(:view_issues)
+ Role.find(1).remove_permission!(:view_issues)
+ user = User.find(2)
+
+ assert_equal 0, Issue.where(:project_id => 1).visible(user).count
+ assert_equal false, Issue.where(:project_id => 1).first.visible?(user)
+ end
+
def test_visible_scope_for_member_with_groups_should_return_assigned_issues
user = User.find(8)
assert user.groups.any?