aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/finder_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2017-01-03 15:52:35 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-01-03 15:53:03 -0500
commit4b6709e818177792735e99a70ec03210c0ac38dc (patch)
treec351e5643be6e670d47d4204c47c798aa9bf7d32 /activerecord/test/cases/finder_test.rb
parentbc87cd7f18373c0cde87c088c410fb2bf50969a9 (diff)
downloadrails-4b6709e818177792735e99a70ec03210c0ac38dc.tar.gz
rails-4b6709e818177792735e99a70ec03210c0ac38dc.tar.bz2
rails-4b6709e818177792735e99a70ec03210c0ac38dc.zip
Raise ArgumentError when a instance of ActiveRecord::Base is passed to
find and exists?
Diffstat (limited to 'activerecord/test/cases/finder_test.rb')
-rw-r--r--activerecord/test/cases/finder_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index f1459ae125..ca22fe969c 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -118,7 +118,7 @@ class FinderTest < ActiveRecord::TestCase
end
def test_find_passing_active_record_object_is_deprecated
- assert_deprecated do
+ assert_raises(ArgumentError) do
Topic.find(Topic.last)
end
end
@@ -167,8 +167,8 @@ class FinderTest < ActiveRecord::TestCase
assert_equal false, relation.exists?(false)
end
- def test_exists_passing_active_record_object_is_deprecated
- assert_deprecated do
+ def test_exists_passing_active_record_object_is_not_permited
+ assert_raises(ArgumentError) do
Topic.exists?(Topic.new)
end
end