aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/finder_test.rb
diff options
context:
space:
mode:
authorLauro Caetano <laurocaetano1@gmail.com>2014-03-13 16:10:04 -0300
committerLauro Caetano <laurocaetano1@gmail.com>2014-03-13 16:10:04 -0300
commita9023eccd682efff0cc7e14057112648195cac58 (patch)
tree394d3f25fecf6d45b2fce28d9c8346d2eae2d8dd /activerecord/test/cases/finder_test.rb
parentf8fb1fa67a80c0d16adb0bb4ed1db6a09341b10f (diff)
downloadrails-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/test/cases/finder_test.rb')
-rw-r--r--activerecord/test/cases/finder_test.rb6
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