From: Andy Allan Date: Wed, 20 Mar 2024 17:05:28 +0000 (+0000) Subject: Fix warning on unescaped hyphen in regexp X-Git-Tag: live~641^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/d04852fa47f5762f88ab91c2653d2f6224932406 Fix warning on unescaped hyphen in regexp --- diff --git a/test/system/user_email_change_test.rb b/test/system/user_email_change_test.rb index eceb73416..ec2c8f093 100644 --- a/test/system/user_email_change_test.rb +++ b/test/system/user_email_change_test.rb @@ -21,9 +21,9 @@ class UserEmailChangeTest < ApplicationSystemTestCase email = ActionMailer::Base.deliveries.first assert_equal 1, email.to.count assert_equal "new_tester@example.com", email.to.first - assert_match %r{/user/confirm-email\?confirm_string=[A-Za-z0-9-_%]+\s}, email.parts[0].parts[0].decoded + assert_match %r{/user/confirm-email\?confirm_string=[A-Za-z0-9\-_%]+\s}, email.parts[0].parts[0].decoded - if email.parts[0].parts[0].decoded =~ %r{(/user/confirm-email\?confirm_string=[A-Za-z0-9-_%]+)\s} + if email.parts[0].parts[0].decoded =~ %r{(/user/confirm-email\?confirm_string=[A-Za-z0-9\-_%]+)\s} visit Regexp.last_match(1) assert page.has_css?("body.accounts-edit") end