aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relations_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-15 15:30:05 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-15 15:30:58 -0800
commit7bf9cbb7667d3725535c1410df95892891665a95 (patch)
tree682ca1d19815173aa87bdc9a137396807c4a8892 /activerecord/test/cases/relations_test.rb
parentbd96e45641df33d91ebc7b1dbb1589b376c6ef24 (diff)
downloadrails-7bf9cbb7667d3725535c1410df95892891665a95.tar.gz
rails-7bf9cbb7667d3725535c1410df95892891665a95.tar.bz2
rails-7bf9cbb7667d3725535c1410df95892891665a95.zip
adding more test coverage around finding with active record objects
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r--activerecord/test/cases/relations_test.rb12
1 files changed, 12 insertions, 0 deletions
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?