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:
parent
af2a011df2
commit
1c283765b6
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue