fix find_all_by_id(n1, n2) parameter at test_not_member_of_scope_should_return_users_that_have_no_memberships of PrincipalTest

find_all_by_id(n1, n2) returns only n1 result.

git-svn-id: http://svn.redmine.org/redmine/trunk@12468 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2013-12-27 03:25:49 +00:00
parent 8ec6004a7f
commit 2959818688
1 changed files with 6 additions and 3 deletions

View File

@ -40,9 +40,12 @@ class PrincipalTest < ActiveSupport::TestCase
end
def test_not_member_of_scope_should_return_users_that_have_no_memberships
projects = Project.find_all_by_id(1, 2)
expected = (Principal.all - projects.map(&:memberships).flatten.map(&:principal)).sort
assert_equal expected, Principal.not_member_of(projects).sort
[[1], [1, 2]].each do |ids|
projects = Project.find(ids)
assert_equal ids.size, projects.count
expected = (Principal.all - projects.map(&:memberships).flatten.map(&:principal)).sort
assert_equal expected, Principal.not_member_of(projects).sort
end
end
def test_not_member_of_scope_should_be_empty_for_no_projects