Skip to content

Commit 809eb88

Browse files
committed
Update coerced_tests.rb
1 parent 0bdfaf0 commit 809eb88

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/cases/coerced_tests.rb

+19
Original file line numberDiff line numberDiff line change
@@ -2475,6 +2475,25 @@ def test_sqlcommenter_format_value_string_coercible_coerced
24752475
end
24762476
end
24772477

2478+
# SQL requires double single-quotes.
2479+
coerce_tests! :test_sqlcommenter_format_allows_string_keys
2480+
def test_sqlcommenter_format_allows_string_keys_coerced
2481+
ActiveRecord::QueryLogs.update_formatter(:sqlcommenter)
2482+
2483+
ActiveRecord::QueryLogs.tags = [
2484+
:application,
2485+
{
2486+
"string" => "value",
2487+
tracestate: "congo=t61rcWkgMzE,rojo=00f067aa0ba902b7",
2488+
custom_proc: -> { "Joe's Shack" }
2489+
},
2490+
]
2491+
2492+
assert_queries_match(%r{custom_proc=''Joe%27s%20Shack'',string=''value'',tracestate=''congo%3Dt61rcWkgMzE%2Crojo%3D00f067aa0ba902b7''\*/}) do
2493+
Dashboard.first
2494+
end
2495+
end
2496+
24782497
# Invalid character encoding causes `ActiveRecord::StatementInvalid` error similar to Postgres.
24792498
coerce_tests! :test_invalid_encoding_query
24802499
def test_invalid_encoding_query_coerced

0 commit comments

Comments
 (0)