diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-06-22 04:28:27 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-06-22 04:28:27 +0900 |
commit | 4dd1eb27ef02704cbfc47b1ebe1ff94f294bf471 (patch) | |
tree | 6f6e910818e36146d080ba343f8d1ead48ead15f /activerecord/test/cases | |
parent | b21f50d8ae36d9b50b673579e17bccbe55363b34 (diff) | |
download | rails-4dd1eb27ef02704cbfc47b1ebe1ff94f294bf471.tar.gz rails-4dd1eb27ef02704cbfc47b1ebe1ff94f294bf471.tar.bz2 rails-4dd1eb27ef02704cbfc47b1ebe1ff94f294bf471.zip |
Add missing test case for `find` with a large number
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index 8324b26ad3..39ffe12ec6 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -355,6 +355,12 @@ class FinderTest < ActiveRecord::TestCase end def test_find_on_relation_with_large_number + assert_raises(ActiveRecord::RecordNotFound) do + Topic.where("1=1").find(9999999999999999999999999999999) + end + end + + def test_find_by_on_relation_with_large_number assert_nil Topic.where("1=1").find_by(id: 9999999999999999999999999999999) end |