summaryrefslogtreecommitdiffstats
path: root/test/unit/group_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-09-28 14:51:08 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-09-28 14:51:08 +0000
commit7e7ac5340a281ed767066af0b5f4dd45a3d7076f (patch)
tree891640b0548c0d3063daddb219006d120fa312c3 /test/unit/group_test.rb
parent9a7fb0ad7be0ee3403f5b89eb0c16b68c991d519 (diff)
downloadredmine-7e7ac5340a281ed767066af0b5f4dd45a3d7076f.tar.gz
redmine-7e7ac5340a281ed767066af0b5f4dd45a3d7076f.zip
Adds buit-in groups to give specific permissions to anonymous and non members users per project (#17976).
git-svn-id: http://svn.redmine.org/redmine/trunk@13417 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/group_test.rb')
-rw-r--r--test/unit/group_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/group_test.rb b/test/unit/group_test.rb
index 188e9468a..d3b5d20ec 100644
--- a/test/unit/group_test.rb
+++ b/test/unit/group_test.rb
@@ -133,4 +133,20 @@ class GroupTest < ActiveSupport::TestCase
assert_equal nil, Issue.find(1).assigned_to_id
end
+
+ def test_builtin_id_with_anonymous_user_should_return_anonymous_group
+ assert_equal 13, Group.builtin_id(User.anonymous)
+ end
+
+ def test_builtin_id_with_anonymous_role_should_return_anonymous_group
+ assert_equal 13, Group.builtin_id(Role.anonymous)
+ end
+
+ def test_builtin_id_with_user_should_return_non_member_group
+ assert_equal 12, Group.builtin_id(User.find(1))
+ end
+
+ def test_builtin_id_with_non_member_role_should_return_non_member_group
+ assert_equal 12, Group.builtin_id(Role.non_member)
+ end
end