summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-14 11:14:24 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-14 11:14:24 +0000
commita4133891e47f8b27278fd6daa54742c2b8aa822a (patch)
treedb9a8644953c983e13300bf355f0652e815556ce /test/unit/user_test.rb
parent7b7a1a3ed59d41708bd3e5b1aa617426e7627ca5 (diff)
downloadredmine-a4133891e47f8b27278fd6daa54742c2b8aa822a.tar.gz
redmine-a4133891e47f8b27278fd6daa54742c2b8aa822a.zip
code cleanup: rubocop: fix Layout/LeadingCommentSpace in test/unit/user_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18654 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r--test/unit/user_test.rb21
1 files changed, 14 insertions, 7 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index da9fbe7ed..20e34d99c 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -1164,8 +1164,10 @@ class UserTest < ActiveSupport::TestCase
test "#allowed_to? for normal users" do
project = Project.find(1)
- assert_equal true, @jsmith.allowed_to?(:delete_messages, project) #Manager
- assert_equal false, @dlopper.allowed_to?(:delete_messages, project) #Developer
+ # Manager
+ assert_equal true, @jsmith.allowed_to?(:delete_messages, project)
+ # Developer
+ assert_equal false, @dlopper.allowed_to?(:delete_messages, project)
end
test "#allowed_to? with empty array should return false" do
@@ -1174,13 +1176,17 @@ class UserTest < ActiveSupport::TestCase
test "#allowed_to? with multiple projects" do
assert_equal true, @admin.allowed_to?(:view_project, Project.all.to_a)
- assert_equal false, @dlopper.allowed_to?(:view_project, Project.all.to_a) #cannot see Project(2)
- assert_equal true, @jsmith.allowed_to?(:edit_issues, @jsmith.projects.to_a) #Manager or Developer everywhere
- assert_equal false, @jsmith.allowed_to?(:delete_issue_watchers, @jsmith.projects.to_a) #Dev cannot delete_issue_watchers
+ # cannot see Project(2)
+ assert_equal false, @dlopper.allowed_to?(:view_project, Project.all.to_a)
+ # Manager or Developer everywhere
+ assert_equal true, @jsmith.allowed_to?(:edit_issues, @jsmith.projects.to_a)
+ # Dev cannot delete_issue_watchers
+ assert_equal false, @jsmith.allowed_to?(:delete_issue_watchers, @jsmith.projects.to_a)
end
test "#allowed_to? with with options[:global] should return true if user has one role with the permission" do
- @dlopper2 = User.find(5) #only Developer on a project, not Manager anywhere
+ # only Developer on a project, not Manager anywhere
+ @dlopper2 = User.find(5)
@anonymous = User.find(6)
assert_equal true, @jsmith.allowed_to?(:delete_issue_watchers, nil, :global => true)
assert_equal false, @dlopper2.allowed_to?(:delete_issue_watchers, nil, :global => true)
@@ -1191,7 +1197,8 @@ class UserTest < ActiveSupport::TestCase
# this is just a proxy method, the test only calls it to ensure it doesn't break trivially
test "#allowed_to_globally?" do
- @dlopper2 = User.find(5) #only Developer on a project, not Manager anywhere
+ # only Developer on a project, not Manager anywhere
+ @dlopper2 = User.find(5)
@anonymous = User.find(6)
assert_equal true, @jsmith.allowed_to_globally?(:delete_issue_watchers)
assert_equal false, @dlopper2.allowed_to_globally?(:delete_issue_watchers)