From 7bf9cbb7667d3725535c1410df95892891665a95 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 15 Nov 2010 15:30:05 -0800 Subject: adding more test coverage around finding with active record objects --- activerecord/test/cases/relations_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'activerecord') diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 13c26a0c15..24539df6ff 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -432,6 +432,18 @@ class RelationTest < ActiveRecord::TestCase 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? -- cgit v1.2.3