diff options
author | Lauro Caetano <laurocaetano1@gmail.com> | 2014-03-13 15:57:35 -0300 |
---|---|---|
committer | Lauro Caetano <laurocaetano1@gmail.com> | 2014-03-13 15:59:54 -0300 |
commit | d3d3d07d99ea8fbfa242a6c2cfa7279aea51bc7c (patch) | |
tree | 1dd0ce1e91500b8ac4b5292bdcba3fec59d6c40a /activerecord | |
parent | d35f0033c7dec2b8d8b52058fb8db495d49596f7 (diff) | |
download | rails-d3d3d07d99ea8fbfa242a6c2cfa7279aea51bc7c.tar.gz rails-d3d3d07d99ea8fbfa242a6c2cfa7279aea51bc7c.tar.bz2 rails-d3d3d07d99ea8fbfa242a6c2cfa7279aea51bc7c.zip |
Test deprecation warning for passing an ActiveRecord object to
`exists?`
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index af33caefa5..9adfc72634 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -61,6 +61,12 @@ class FinderTest < ActiveRecord::TestCase 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 |