Skip to content

Commit 7ca8c45

Browse files
authored
Coerce sanitize test (#1079)
1 parent be44633 commit 7ca8c45

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/cases/coerced_tests.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,13 @@ def self.search_as_method(term)
14231423
searchable_post.search_as_scope("20% _reduction_!").to_a
14241424
end
14251425
end
1426+
1427+
# Use nvarchar string (N'') in assert
1428+
coerce_tests! :test_named_bind_with_literal_colons
1429+
def test_named_bind_with_literal_colons_coerced
1430+
assert_equal "TO_TIMESTAMP(N'2017/08/02 10:59:00', 'YYYY/MM/DD HH12:MI:SS')", bind("TO_TIMESTAMP(:date, 'YYYY/MM/DD HH12\\:MI\\:SS')", date: "2017/08/02 10:59:00")
1431+
assert_raise(ActiveRecord::PreparedStatementInvalid) { bind "TO_TIMESTAMP(:date, 'YYYY/MM/DD HH12:MI:SS')", date: "2017/08/02 10:59:00" }
1432+
end
14261433
end
14271434

14281435
class SchemaDumperTest < ActiveRecord::TestCase

0 commit comments

Comments
 (0)