aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/arel/collectors
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-09-30 16:41:43 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-09-30 16:49:13 +0900
commit298629cefd845caf2cea28eb9cee2b538accc4ee (patch)
treee23abd645f369e742f96c18c4898a0f72cf747de /activerecord/test/cases/arel/collectors
parent683a0b5042262d841bfed687a4c56125364cf7a7 (diff)
downloadrails-298629cefd845caf2cea28eb9cee2b538accc4ee.tar.gz
rails-298629cefd845caf2cea28eb9cee2b538accc4ee.tar.bz2
rails-298629cefd845caf2cea28eb9cee2b538accc4ee.zip
`SQLString#compile` is no longer used since 53521a9e39b9d8af4165d7703c36dc905f1f8f67
Diffstat (limited to 'activerecord/test/cases/arel/collectors')
-rw-r--r--activerecord/test/cases/arel/collectors/sql_string_test.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/activerecord/test/cases/arel/collectors/sql_string_test.rb b/activerecord/test/cases/arel/collectors/sql_string_test.rb
index 380573494d..443c7eb54b 100644
--- a/activerecord/test/cases/arel/collectors/sql_string_test.rb
+++ b/activerecord/test/cases/arel/collectors/sql_string_test.rb
@@ -19,27 +19,21 @@ module Arel
collect(node).value
end
- def ast_with_binds(bv)
+ def ast_with_binds
table = Table.new(:users)
manager = Arel::SelectManager.new table
- manager.where(table[:age].eq(bv))
- manager.where(table[:name].eq(bv))
+ manager.where(table[:age].eq(Nodes::BindParam.new("hello")))
+ manager.where(table[:name].eq(Nodes::BindParam.new("world")))
manager.ast
end
def test_compile
- bv = Nodes::BindParam.new(1)
- collector = collect ast_with_binds bv
-
- sql = collector.compile ["hello", "world"]
+ sql = compile(ast_with_binds)
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"]
+ sql = compile(ast_with_binds)
assert_equal sql.encoding, Encoding::UTF_8
end
end