]> source.dussan.org Git - redmine.git/commitdiff
fix find_all_by_id(n1, n2) parameter at test_member_of_scope_should_return_the_union_...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 27 Dec 2013 03:26:05 +0000 (03:26 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 27 Dec 2013 03:26:05 +0000 (03:26 +0000)
find_all_by_id(n1, n2) returns only n1 result.

git-svn-id: http://svn.redmine.org/redmine/trunk@12469 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/principal_test.rb

index bbf8710509536cdd0c2f155edfc466a35659d2d4..3c8a803ec20e9be8bca88cc515b37f5e6b6d0be0 100644 (file)
@@ -31,8 +31,10 @@ class PrincipalTest < ActiveSupport::TestCase
   end
 
   def test_member_of_scope_should_return_the_union_of_all_members
-    projects = Project.find_all_by_id(1, 2)
-    assert_equal projects.map(&:principals).flatten.sort, Principal.member_of(projects).sort
+    projects = Project.find([1])
+    assert_equal [3, 2], Principal.member_of(projects).sort.map(&:id)
+    projects = Project.find([1, 2])
+    assert_equal [3, 2, 8, 11], Principal.member_of(projects).sort.map(&:id)
   end
 
   def test_member_of_scope_should_be_empty_for_no_projects