Skip to content

Commit

Permalink
Do proper adapter check
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Mar 10, 2014
1 parent 0e5fb0b commit 18b9595
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/test/cases/finder_test.rb
Expand Up @@ -64,7 +64,7 @@ def test_exists
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
Expand All @@ -73,7 +73,7 @@ def test_exists_fails_when_parameter_has_invalid_type

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
Expand Down

0 comments on commit 18b9595

Please sign in to comment.