diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-14 07:15:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-14 07:15:13 +0000 |
commit | d2f7e31951d0e150df9cfd6da7d91d855f734d5f (patch) | |
tree | 35dfd4e7ff86f66c9eacb5bec14c63e920913896 /test | |
parent | e58e676b7c15bb3f837f660f857d8e2a3e35f233 (diff) | |
download | redmine-d2f7e31951d0e150df9cfd6da7d91d855f734d5f.tar.gz redmine-d2f7e31951d0e150df9cfd6da7d91d855f734d5f.zip |
Use .distinct instead of .uniq.
git-svn-id: http://svn.redmine.org/redmine/trunk@15654 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/issues_test.rb | 2 | ||||
-rw-r--r-- | test/unit/project_members_inheritance_test.rb | 4 | ||||
-rw-r--r-- | test/unit/project_test.rb | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb index 5cafcda4b..76a417c92 100644 --- a/test/integration/issues_test.rb +++ b/test/integration/issues_test.rb @@ -172,7 +172,7 @@ class IssuesTest < Redmine::IntegrationTest def test_issue_with_user_custom_field @field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user', :is_for_all => true, :trackers => Tracker.all) Role.anonymous.add_permission! :add_issues, :edit_issues - users = Project.find(1).users.uniq.sort + users = Project.find(1).users.sort tester = users.first # Issue form 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 |