Permalink
Browse files

Merge pull request #14375 from laurocaetano/test-deprecation-warning-…

…for-exists

Add test for deprecation warning for passing an AR object to `exists?`.
  • Loading branch information...
2 parents 499c6aa + d3d3d07 commit f8fb1fa67a80c0d16adb0bb4ed1db6a09341b10f @tenderlove tenderlove committed Mar 13, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 activerecord/test/cases/finder_test.rb
@@ -61,6 +61,12 @@ def test_exists
assert_raise(NoMethodError) { Topic.exists?([1,2]) }
end
+ def test_exists_passing_active_record_object_is_deprecated
+ assert_deprecated do
+ Topic.exists?(Topic.new)
+ end
+ end
+
def test_exists_fails_when_parameter_has_invalid_type
if current_adapter?(:PostgreSQLAdapter, :MysqlAdapter)
assert_raises ActiveRecord::StatementInvalid do

0 comments on commit f8fb1fa

Please sign in to comment.