Skip to content

Commit

Permalink
mysql adapter also fails with a number bigger than int
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Mar 10, 2014
1 parent a1ad848 commit d50f753
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions activerecord/test/cases/finder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,19 @@ def test_exists
end

def test_exists_fails_when_parameter_has_invalid_type
if current_adapter?(:PostgreSQLAdapter)
if current_adapter?(:PostgreSQLAdapter, :MysqlAdapter)
assert_raises ActiveRecord::StatementInvalid do
Topic.exists?(("9"*53).to_i) # number that's bigger than int
end
else
assert_equal false, Topic.exists?(("9"*53).to_i) # number that's bigger than int
end

if current_adapter?(:PostgreSQLAdapter)
assert_raises ActiveRecord::StatementInvalid do
Topic.exists?("foo")
end
else
assert_equal false, Topic.exists?(("9"*53).to_i) # number that's bigger than int
assert_equal false, Topic.exists?("foo")
end
end
Expand Down

0 comments on commit d50f753

Please sign in to comment.