diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-15 11:55:43 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-15 11:55:43 +0000 |
commit | 57ed93ee66d99eb2cbcbcab3207fe9a8d293ce85 (patch) | |
tree | c812ff18eb29f6f4c91ce5c3ed8f260d70fe9947 /activerecord/test | |
parent | df28bdd7ab05607a6514d8e77df54eb531027687 (diff) | |
download | rails-57ed93ee66d99eb2cbcbcab3207fe9a8d293ce85.tar.gz rails-57ed93ee66d99eb2cbcbcab3207fe9a8d293ce85.tar.bz2 rails-57ed93ee66d99eb2cbcbcab3207fe9a8d293ce85.zip |
Fixed that Base#find will return an array if given an array -- regardless of the number of elements #270 [Marten]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/finder_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb index ca78fbe651..fbe4ef56f3 100755 --- a/activerecord/test/finder_test.rb +++ b/activerecord/test/finder_test.rb @@ -14,9 +14,14 @@ class FinderTest < Test::Unit::TestCase assert_equal(@topic_fixtures["first"]["title"], Topic.find(1).title) end + def test_find_by_array_of_one_id + assert_kind_of(Array, Topic.find([ 1 ])) + assert_equal(1, Topic.find([ 1 ]).length) + end + def test_find_by_ids assert_equal(2, Topic.find(1, 2).length) - assert_equal(@topic_fixtures["second"]["title"], Topic.find([ 2 ]).title) + assert_equal(@topic_fixtures["second"]["title"], Topic.find([ 2 ]).first.title) end def test_find_by_ids_missing_one |