1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

added a test for relation which checks intersection between a relation and an array works in both directions

Signed-off-by: Mikel Lindsaar <raasdnil@gmail.com>
This commit is contained in:
kane 2010-09-08 21:53:58 -03:00 committed by Mikel Lindsaar
parent af2a011df2
commit 1c283765b6

View file

@ -699,5 +699,11 @@ class RelationTest < ActiveRecord::TestCase
assert_equal 'zyke', car.name
end
def test_intersection_with_array
relation = Author.where(:name => "David")
rails_author = relation.first
assert_equal [rails_author], [rails_author] & relation
assert_equal [rails_author], relation & [rails_author]
end
end