Skip to content
Browse files

Test deprecation warning for passing an ActiveRecord object to

`exists?`
  • Loading branch information...
1 parent d35f003 commit d3d3d07d99ea8fbfa242a6c2cfa7279aea51bc7c @laurocaetano laurocaetano committed Mar 13, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 activerecord/test/cases/finder_test.rb
View
6 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 d3d3d07

Please sign in to comment.
Something went wrong with that request. Please try again.