@@ -40,9 +40,12 class PrincipalTest < ActiveSupport::TestCase | |||||
40 | end |
|
40 | end | |
41 |
|
41 | |||
42 | def test_not_member_of_scope_should_return_users_that_have_no_memberships |
|
42 | def test_not_member_of_scope_should_return_users_that_have_no_memberships | |
43 | projects = Project.find_all_by_id(1, 2) |
|
43 | [[1], [1, 2]].each do |ids| | |
44 | expected = (Principal.all - projects.map(&:memberships).flatten.map(&:principal)).sort |
|
44 | projects = Project.find(ids) | |
45 | assert_equal expected, Principal.not_member_of(projects).sort |
|
45 | assert_equal ids.size, projects.count | |
|
46 | expected = (Principal.all - projects.map(&:memberships).flatten.map(&:principal)).sort | |||
|
47 | assert_equal expected, Principal.not_member_of(projects).sort | |||
|
48 | end | |||
46 | end |
|
49 | end | |
47 |
|
50 | |||
48 | def test_not_member_of_scope_should_be_empty_for_no_projects |
|
51 | def test_not_member_of_scope_should_be_empty_for_no_projects |
General Comments 0
You need to be logged in to leave comments.
Login now