diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-21 16:36:18 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-21 16:36:18 +0000 |
commit | a9fd639adf44cb17c6e3cd4f82d0025c8a7dcb64 (patch) | |
tree | 258a958618569d1653efaba1d5249e2cec3c8fbe /activerecord/test | |
parent | 361be5a7dd1d70e55d6b003b987794e94b2f9c1e (diff) | |
download | rails-a9fd639adf44cb17c6e3cd4f82d0025c8a7dcb64.tar.gz rails-a9fd639adf44cb17c6e3cd4f82d0025c8a7dcb64.tar.bz2 rails-a9fd639adf44cb17c6e3cd4f82d0025c8a7dcb64.zip |
Fixed that calling Model.find([]) returns [] and doesn't throw an exception #1379
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1471 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/finder_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb index 307fd0934c..06c5229433 100644 --- a/activerecord/test/finder_test.rb +++ b/activerecord/test/finder_test.rb @@ -28,6 +28,10 @@ class FinderTest < Test::Unit::TestCase assert_equal(topics(:second).title, Topic.find([ 2 ]).first.title) end + def test_find_an_empty_array + assert_equal [], Topic.find([]) + end + def test_find_by_ids_missing_one assert_raises(ActiveRecord::RecordNotFound) { Topic.find(1, 2, 45) |