Permalink
Browse files

adding more test coverage around finding with active record objects

  • Loading branch information...
1 parent e2266cf commit ed91716439c2f3472f5545884628d5ebb7c2f890 @tenderlove tenderlove committed Nov 15, 2010
Showing with 12 additions and 0 deletions.
  1. +12 −0 activerecord/test/cases/relations_test.rb
@@ -427,6 +427,18 @@ def test_where_with_ar_object
assert_equal 1, authors.all.length
end
+ def test_find_with_list_of_ar
+ author = Author.first
+ authors = Author.find([author])
+ assert_equal author, authors.first
+ end
+
+ def test_find_by_id_with_list_of_ar
+ author = Author.first
+ authors = Author.find_by_id([author])
+ assert_equal author, authors
+ end
+
def test_exists
davids = Author.where(:name => 'David')
assert davids.exists?

0 comments on commit ed91716

Please sign in to comment.