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:
parent
8ec6004a7f
commit
2959818688
|
@ -40,10 +40,13 @@ 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)
|
||||
[[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
|
||||
assert_equal [], Principal.not_member_of([]).sort
|
||||
|
|
Loading…
Reference in New Issue