From fc9f996801cdfc041ed194b4235010235f686278 Mon Sep 17 00:00:00 2001 From: Jonathan Hefner Date: Tue, 30 Nov 2021 10:43:36 -0600 Subject: [PATCH] Fix bind_parameter_test regexp The previous regexp consisted of a single character class pattern. i.e. `assert_match` would always pass if the given string contained at least one of the characters in the regexp. This commit changes the regexp to check for the intended substring. --- activerecord/test/cases/bind_parameter_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/test/cases/bind_parameter_test.rb b/activerecord/test/cases/bind_parameter_test.rb index 79bfdaebab..b7fea26212 100644 --- a/activerecord/test/cases/bind_parameter_test.rb +++ b/activerecord/test/cases/bind_parameter_test.rb @@ -310,7 +310,7 @@ if ActiveRecord::Base.connection.prepared_statements }.new logger.sql(event) - assert_match %r([[auth_token, [FILTERED]]]), logger.debugs.first + assert_match %r/#{Regexp.escape '[["auth_token", "[FILTERED]"]]'}/, logger.debugs.first end end end