diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-17 14:08:00 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-17 14:08:00 -0800 |
commit | c1bbf1b2e412b41340cb48c1c23cddb93f362944 (patch) | |
tree | 1fe189faea7177edd497cbceda75a2771a00352c | |
parent | 486db21f919c39cef76b487be45290b7561307e8 (diff) | |
download | rails-c1bbf1b2e412b41340cb48c1c23cddb93f362944.tar.gz rails-c1bbf1b2e412b41340cb48c1c23cddb93f362944.tar.bz2 rails-c1bbf1b2e412b41340cb48c1c23cddb93f362944.zip |
test to ensure bad prepared statements raise a StatementInvalid exception
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/schema_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/schema_test.rb b/activerecord/test/cases/adapters/postgresql/schema_test.rb index e8dd188ec8..1e59bca6a7 100644 --- a/activerecord/test/cases/adapters/postgresql/schema_test.rb +++ b/activerecord/test/cases/adapters/postgresql/schema_test.rb @@ -115,6 +115,12 @@ class SchemaTest < ActiveRecord::TestCase 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]] |