diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-03-10 10:20:27 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-03-10 10:20:27 -0300 |
commit | 18b9595814057095084f508b6837ad3c7331079f (patch) | |
tree | 4c48dbc99dd28e6204d1d5e4860ac8d07e6e3e47 /activerecord | |
parent | 0e5fb0ba9cccf511745e14f3eb6e9f408a1a827c (diff) | |
download | rails-18b9595814057095084f508b6837ad3c7331079f.tar.gz rails-18b9595814057095084f508b6837ad3c7331079f.tar.bz2 rails-18b9595814057095084f508b6837ad3c7331079f.zip |
Do proper adapter check
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index 78c4e02434..0ab3830323 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -64,7 +64,7 @@ class FinderTest < ActiveRecord::TestCase def test_exists_fails_when_parameter_has_invalid_type begin assert_equal false, Topic.exists?(("9"*53).to_i) # number that's bigger than int - flunk if defined? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter and Topic.connection.is_a? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter # PostgreSQL does raise here + flunk if current_adapter?(:PostgreSQLAdapter) # PostgreSQL does raise here rescue ActiveRecord::StatementInvalid # PostgreSQL complains that it can't coerce a numeric that's bigger than int into int rescue Exception @@ -73,7 +73,7 @@ class FinderTest < ActiveRecord::TestCase begin assert_equal false, Topic.exists?("foo") - flunk if defined? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter and Topic.connection.is_a? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter # PostgreSQL does raise here + flunk if current_adapter?(:PostgreSQLAdapter) # PostgreSQL does raise here rescue ActiveRecord::StatementInvalid # PostgreSQL complains about string comparison with integer field rescue Exception |