diff options
author | Miguel Grazziotin <miguelgraz@gmail.com> | 2015-06-03 22:07:37 -0300 |
---|---|---|
committer | Miguel Grazziotin <miguelgraz@gmail.com> | 2015-06-03 22:07:37 -0300 |
commit | 4e63a7b4b051aa8dc7ae53f46ea27cf421863561 (patch) | |
tree | da46fee0175d31db9ef742d2994a1f7fc41dfa8e /activerecord/test/cases | |
parent | 91276036ecf2745a44399b11a9779b8bec7c7fbb (diff) | |
download | rails-4e63a7b4b051aa8dc7ae53f46ea27cf421863561.tar.gz rails-4e63a7b4b051aa8dc7ae53f46ea27cf421863561.tar.bz2 rails-4e63a7b4b051aa8dc7ae53f46ea27cf421863561.zip |
adding a test to ensure the find is obbeying the limit
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index 445b20ca2a..3ea1299b1c 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -78,6 +78,13 @@ class FinderTest < ActiveRecord::TestCase assert_equal 'The Fifth Topic of the day', records[2].title end + def test_find_with_ids_and_limit + records = Topic.limit(2).find([4,2,5]) + assert_equal 2, records.size + assert_equal 'The Fourth Topic of the day', records[0].title + assert_equal 'The Second Topic of the day', records[1].title + end + def test_find_passing_active_record_object_is_deprecated assert_deprecated do Topic.find(Topic.last) |