summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2014-09-06 03:39:52 +0000
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2014-09-06 03:39:52 +0000
commitd00f875800fce1ec047570d8972c833d9da91858 (patch)
tree773f519dae83b2dfbb106b5ea17f1f9747949bad /test/unit/user_test.rb
parent63cb3680c14b8582bc587917cac6d3ede604e412 (diff)
downloadredmine-d00f875800fce1ec047570d8972c833d9da91858.tar.gz
redmine-d00f875800fce1ec047570d8972c833d9da91858.zip
Make 2nd parameter optional in User#allowed_to_globally? for consistency (#6498).
git-svn-id: http://svn.redmine.org/redmine/trunk@13364 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r--test/unit/user_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index aa930a7a9..847c25c3b 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -1019,6 +1019,19 @@ class UserTest < ActiveSupport::TestCase
end
end
+ # this is just a proxy method, the test only calls it to ensure it doesn't break trivially
+ context "#allowed_to_globally?" do
+ should "proxy to #allowed_to? and reflect global permissions" do
+ @dlopper2 = User.find(5) #only Developper on a project, not Manager anywhere
+ @anonymous = User.find(6)
+ assert_equal true, @jsmith.allowed_to_globally?(:delete_issue_watchers)
+ assert_equal false, @dlopper2.allowed_to_globally?(:delete_issue_watchers)
+ assert_equal true, @dlopper2.allowed_to_globally?(:add_issues)
+ assert_equal false, @anonymous.allowed_to_globally?(:add_issues)
+ assert_equal true, @anonymous.allowed_to_globally?(:view_issues)
+ end
+ end
+
context "User#notify_about?" do
context "Issues" do
setup do