diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 8b6cd56a39..0466dc7268 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -146,7 +146,7 @@ def request_method end # Returns the URI pattern of the matched route for the request, - # using the same format as `bin/rails routes`: + # using the same format as bin/rails routes: # # request.route_uri_pattern # => "/:controller(/:action(/:id))(.:format)" def route_uri_pattern diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 98b3cd8ca4..fb00f454ec 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -360,6 +360,11 @@ def test_route_uri_pattern "/:controller(/:action(/:id))(.:format)", controller.request.route_uri_pattern ) + + assert_equal( + "/:controller(/:action(/:id))(.:format)", + controller.request.get_header("action_dispatch.route_uri_pattern") + ) end def test_route_with_colon_first