diff options
author | Lauro Caetano <laurocaetano1@gmail.com> | 2014-03-13 16:10:04 -0300 |
---|---|---|
committer | Lauro Caetano <laurocaetano1@gmail.com> | 2014-03-13 16:10:04 -0300 |
commit | a9023eccd682efff0cc7e14057112648195cac58 (patch) | |
tree | 394d3f25fecf6d45b2fce28d9c8346d2eae2d8dd /activerecord | |
parent | f8fb1fa67a80c0d16adb0bb4ed1db6a09341b10f (diff) | |
download | rails-a9023eccd682efff0cc7e14057112648195cac58.tar.gz rails-a9023eccd682efff0cc7e14057112648195cac58.tar.bz2 rails-a9023eccd682efff0cc7e14057112648195cac58.zip |
Add test for deprecation warning for passing an AR object to `find`.
Diffstat (limited to 'activerecord')
-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 9adfc72634..c0440744e9 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -33,6 +33,12 @@ class FinderTest < ActiveRecord::TestCase assert_equal(topics(:first).title, Topic.find(1).title) end + def test_find_passing_active_record_object_is_deprecated + assert_deprecated do + Topic.find(Topic.last) + end + end + def test_symbols_table_ref Post.first # warm up x = Symbol.all_symbols.count |