Permalink
Browse files

test to ensure bad prepared statements raise a StatementInvalid excep…

…tion
  • Loading branch information...
1 parent 486db21 commit c1bbf1b2e412b41340cb48c1c23cddb93f362944 @tenderlove tenderlove committed Jan 17, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 activerecord/test/cases/adapters/postgresql/schema_test.rb
View
6 activerecord/test/cases/adapters/postgresql/schema_test.rb
@@ -115,6 +115,12 @@ def test_raise_drop_schema_with_nonexisting_schema
end
end
+ def test_raise_wraped_exception_on_bad_prepare
+ assert_raises(ActiveRecord::StatementInvalid) do
+ @connection.exec_query "select * from developers where id = ?", 'sql', [[nil, 1]]
+ end
+ end
+
def test_schema_change_with_prepared_stmt
altered = false
@connection.exec_query "select * from developers where id = $1", 'sql', [[nil, 1]]

0 comments on commit c1bbf1b

Please sign in to comment.