aboutsummaryrefslogtreecommitdiffstats
path: root/test/collectors/test_sql_string.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/collectors/test_sql_string.rb')
-rw-r--r--test/collectors/test_sql_string.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/collectors/test_sql_string.rb b/test/collectors/test_sql_string.rb
index 92f1bf0fba..0185f2ab17 100644
--- a/test/collectors/test_sql_string.rb
+++ b/test/collectors/test_sql_string.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
require 'helper'
-require 'arel/collectors/bind'
module Arel
module Collectors
@@ -28,12 +27,20 @@ module Arel
end
def test_compile
- bv = Nodes::BindParam.new
+ bv = Nodes::BindParam.new(1)
collector = collect ast_with_binds bv
sql = collector.compile ["hello", "world"]
assert_equal 'SELECT FROM "users" WHERE "users"."age" = ? AND "users"."name" = ?', sql
end
+
+ def test_returned_sql_uses_utf8_encoding
+ bv = Nodes::BindParam.new(1)
+ collector = collect ast_with_binds bv
+
+ sql = collector.compile ["hello", "world"]
+ assert_equal sql.encoding, Encoding::UTF_8
+ end
end
end
end