File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2475,6 +2475,25 @@ def test_sqlcommenter_format_value_string_coercible_coerced
2475
2475
end
2476
2476
end
2477
2477
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
+
2478
2497
# Invalid character encoding causes `ActiveRecord::StatementInvalid` error similar to Postgres.
2479
2498
coerce_tests! :test_invalid_encoding_query
2480
2499
def test_invalid_encoding_query_coerced
You can’t perform that action at this time.
0 commit comments