aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapter_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-02-29 12:22:08 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-02-29 12:22:08 +0900
commit8d7554e919b8350eba6e675cb24ae28f4e915ee5 (patch)
tree13154082016381986e4ff4c67661bfbb2a1fc1de /activerecord/test/cases/adapter_test.rb
parente4ad3b26d946d56907e64e767b607f53be73d458 (diff)
downloadrails-8d7554e919b8350eba6e675cb24ae28f4e915ee5.tar.gz
rails-8d7554e919b8350eba6e675cb24ae28f4e915ee5.tar.bz2
rails-8d7554e919b8350eba6e675cb24ae28f4e915ee5.zip
Fix tests failure with `prepared_statements: false`
Some tests does not work for unprepared statements. Add `if ActiveRecord::Base.connection.prepared_statements` and fix a regex for fix tests failure with `prepared_statements: false`.
Diffstat (limited to 'activerecord/test/cases/adapter_test.rb')
-rw-r--r--activerecord/test/cases/adapter_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb
index 0ee147cdba..a9f1993842 100644
--- a/activerecord/test/cases/adapter_test.rb
+++ b/activerecord/test/cases/adapter_test.rb
@@ -11,7 +11,8 @@ module ActiveRecord
##
# PostgreSQL does not support null bytes in strings
- unless current_adapter?(:PostgreSQLAdapter)
+ unless current_adapter?(:PostgreSQLAdapter) ||
+ (current_adapter?(:SQLite3Adapter) && !ActiveRecord::Base.connection.prepared_statements)
def test_update_prepared_statement
b = Book.create(name: "my \x00 book")
b.reload