From d2f7e31951d0e150df9cfd6da7d91d855f734d5f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 14 Jul 2016 07:15:13 +0000 Subject: Use .distinct instead of .uniq. git-svn-id: http://svn.redmine.org/redmine/trunk@15654 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/project_members_inheritance_test.rb | 4 ++-- test/unit/project_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test/unit') diff --git a/test/unit/project_members_inheritance_test.rb b/test/unit/project_members_inheritance_test.rb index 43f52d832..74b798774 100644 --- a/test/unit/project_members_inheritance_test.rb +++ b/test/unit/project_members_inheritance_test.rb @@ -242,7 +242,7 @@ class ProjectMembersInheritanceTest < ActiveSupport::TestCase member = project.reload.memberships.detect {|m| m.principal == user} assert_not_nil member - assert_equal [1, 2, 3], member.roles.uniq.sort.map(&:id) + assert_equal [1, 2, 3], member.roles.map(&:id).uniq.sort end end @@ -258,7 +258,7 @@ class ProjectMembersInheritanceTest < ActiveSupport::TestCase member = project.reload.memberships.detect {|m| m.principal == user} assert_not_nil member - assert_equal [1, 2, 3], member.roles.uniq.sort.map(&:id) + assert_equal [1, 2, 3], member.roles.map(&:id).uniq.sort end end end diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index 5c305f7bf..9a0d9bdd9 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -992,12 +992,12 @@ class ProjectTest < ActiveSupport::TestCase assert_include 'closed', p.css_classes.split end - def test_combination_of_visible_and_uniq_scopes_in_case_anonymous_group_has_memberships_should_not_error + def test_combination_of_visible_and_distinct_scopes_in_case_anonymous_group_has_memberships_should_not_error project = Project.find(1) member = Member.create!(:project => project, :principal => Group.anonymous, :roles => [Role.generate!]) project.members << member assert_nothing_raised do - Project.uniq.visible.to_a + Project.distinct.visible.to_a end end end -- cgit v1.2.3