Skip to content

Commit

Permalink
Test deprecation warning for passing an ActiveRecord object to
Browse files Browse the repository at this point in the history
`exists?`
  • Loading branch information
laurocaetano committed Mar 13, 2014
1 parent d35f003 commit d3d3d07
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions activerecord/test/cases/finder_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit d3d3d07

Please sign in to comment.