summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-09 14:12:38 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-09 14:12:38 +0000
commit287a4f9e1c19a0114f18254fc85b789f49393472 (patch)
tree8076092117185e3c84f46f762b94d0265a92fc42
parentee22339c61989802d89903bf55302841a3231340 (diff)
downloadredmine-287a4f9e1c19a0114f18254fc85b789f49393472.tar.gz
redmine-287a4f9e1c19a0114f18254fc85b789f49393472.zip
shorten long line of test/unit/member_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20598 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/member_test.rb27
1 files changed, 21 insertions, 6 deletions
diff --git a/test/unit/member_test.rb b/test/unit/member_test.rb
index d774676ce..3b4280689 100644
--- a/test/unit/member_test.rb
+++ b/test/unit/member_test.rb
@@ -171,7 +171,8 @@ class MemberTest < ActiveSupport::TestCase
def test_managed_roles_should_return_all_roles_for_role_with_all_roles_managed
member = Member.new
- member.roles << Role.generate!(:permissions => [:manage_members], :all_roles_managed => true)
+ member.roles <<
+ Role.generate!(:permissions => [:manage_members], :all_roles_managed => true)
assert_equal Role.givable.all, member.managed_roles
end
@@ -183,14 +184,20 @@ class MemberTest < ActiveSupport::TestCase
def test_managed_roles_should_return_limited_roles_for_role_without_all_roles_managed
member = Member.new
- member.roles << Role.generate!(:permissions => [:manage_members], :all_roles_managed => false, :managed_role_ids => [2, 3])
+ member.roles <<
+ Role.generate!(:permissions => [:manage_members],
+ :all_roles_managed => false, :managed_role_ids => [2, 3])
assert_equal [2, 3], member.managed_roles.map(&:id).sort
end
def test_managed_roles_should_cumulated_managed_roles
member = Member.new
- member.roles << Role.generate!(:permissions => [:manage_members], :all_roles_managed => false, :managed_role_ids => [3])
- member.roles << Role.generate!(:permissions => [:manage_members], :all_roles_managed => false, :managed_role_ids => [2])
+ member.roles <<
+ Role.generate!(:permissions => [:manage_members],
+ :all_roles_managed => false, :managed_role_ids => [3])
+ member.roles <<
+ Role.generate!(:permissions => [:manage_members],
+ :all_roles_managed => false, :managed_role_ids => [2])
assert_equal [2, 3], member.managed_roles.map(&:id).sort
end
@@ -206,8 +213,16 @@ class MemberTest < ActiveSupport::TestCase
user = User.generate!
assert_difference 'Member.count', 2 do
- members = Member.create_principal_memberships(user, :project_ids => [parent.id, child.id], :role_ids => [1])
- assert members.none?(&:new_record?), "Unsaved members were returned: #{members.select(&:new_record?).map{|m| m.errors.full_messages}*","}"
+ members =
+ Member.create_principal_memberships(
+ user,
+ :project_ids => [parent.id, child.id],
+ :role_ids => [1]
+ )
+ assert(
+ members.none?(&:new_record?),
+ "Unsaved members were returned: #{members.select(&:new_record?).map{|m| m.errors.full_messages}*","}"
+ )
end
end
end