From 10da5ee397dd20959a4c7aef1ac1a928c958bbcb Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Sun, 4 Aug 2024 23:55:19 +0000 Subject: [PATCH] Be more specific with my use of regexs --- spec/features/activate_account_spec.rb | 4 ++-- spec/features/sign_up_for_alerts_spec.rb | 2 +- spec/spec_helper.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/features/activate_account_spec.rb b/spec/features/activate_account_spec.rb index f538d98f8..f11489cbc 100644 --- a/spec/features/activate_account_spec.rb +++ b/spec/features/activate_account_spec.rb @@ -63,7 +63,7 @@ expect(current_email.default_part_body.to_s).to include("Thanks for getting onboard!") # Do these shenanigans to get the first link in this case - link = links_in_email(current_email).find { |u| u =~ %r{https://dev.planningalerts.org.au} } + link = links_in_email(current_email).find { |u| u =~ %r{https://dev\.planningalerts\.org\.au} } visit request_uri(link) fill_in "Your full name", with: "Matthew" @@ -125,7 +125,7 @@ expect(current_email.default_part_body.to_s).to include("Thanks for getting onboard!") # Do these shenanigans to get the first link in this case - link = links_in_email(current_email).find { |u| u =~ %r{https://dev.planningalerts.org.au} } + link = links_in_email(current_email).find { |u| u =~ %r{https://dev\.planningalerts\.org\.au} } visit request_uri(link) fill_in "Your full name", with: "Matthew" diff --git a/spec/features/sign_up_for_alerts_spec.rb b/spec/features/sign_up_for_alerts_spec.rb index 5657bdcfc..f16eeaa71 100644 --- a/spec/features/sign_up_for_alerts_spec.rb +++ b/spec/features/sign_up_for_alerts_spec.rb @@ -143,7 +143,7 @@ expect(current_email).to have_subject("PlanningAlerts: Confirmation instructions") # Do these shenanigans to get the first link in this case - link = links_in_email(current_email).find { |u| u =~ %r{https://dev.planningalerts.org.au} } + link = links_in_email(current_email).find { |u| u =~ %r{https://dev\.planningalerts\.org\.au} } visit request_uri(link) expect(page).to have_content("Your email address has been successfully confirmed and you are now logged in.") diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bf58b4075..0aadfb9b3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -28,7 +28,7 @@ # which automatically downloads the webdriver for headless testing c.ignore_hosts "github.com" c.ignore_request do |request| - URI(request.uri).host =~ /objects.githubusercontent.com/ + URI(request.uri).host =~ /objects\.githubusercontent\.com/ # false # URI(request.uri).port == 7777 end