aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/assertions/routing.rb
diff options
context:
space:
mode:
authorRichard Schneeman <richard.schneeman+no-recruiters@gmail.com>2018-07-28 21:58:36 -0500
committerGitHub <noreply@github.com>2018-07-28 21:58:36 -0500
commitf10acfa7b64ac93cbbfc97e3a92d644960198764 (patch)
tree244ed8c81174abd2ae651f93781425f518688be9 /actionpack/lib/action_dispatch/testing/assertions/routing.rb
parent8741052ba25722283ea057f6f022f16b1931ce3e (diff)
parent27c6c071165342c770ed9c697024aa101dad4049 (diff)
downloadrails-f10acfa7b64ac93cbbfc97e3a92d644960198764.tar.gz
rails-f10acfa7b64ac93cbbfc97e3a92d644960198764.tar.bz2
rails-f10acfa7b64ac93cbbfc97e3a92d644960198764.zip
Merge pull request #32695 from bdewater/enable-regex-cops
Enable regex cops
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions/routing.rb')
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/routing.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb
index 5390581139..77cb311630 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb
@@ -78,7 +78,7 @@ module ActionDispatch
# # Asserts that the generated route gives us our custom route
# assert_generates "changesets/12", { controller: 'scm', action: 'show_diff', revision: "12" }
def assert_generates(expected_path, options, defaults = {}, extras = {}, message = nil)
- if expected_path =~ %r{://}
+ if %r{://}.match?(expected_path)
fail_on(URI::InvalidURIError, message) do
uri = URI.parse(expected_path)
expected_path = uri.path.to_s.empty? ? "/" : uri.path
@@ -189,7 +189,7 @@ module ActionDispatch
request = ActionController::TestRequest.create @controller.class
- if path =~ %r{://}
+ if %r{://}.match?(path)
fail_on(URI::InvalidURIError, msg) do
uri = URI.parse(path)
request.env["rack.url_scheme"] = uri.scheme || "http"