Skip to content

Commit 572f475

Browse files
authored
Merge pull request rails#47306 from zzak/re-47129
Follow up to HTTP::Request#route_uri_pattern
2 parents 0915a3e + 0c71b60 commit 572f475

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

actionpack/lib/action_dispatch/http/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def request_method
146146
end
147147

148148
# Returns the URI pattern of the matched route for the request,
149-
# using the same format as `bin/rails routes`:
149+
# using the same format as <tt>bin/rails routes</tt>:
150150
#
151151
# request.route_uri_pattern # => "/:controller(/:action(/:id))(.:format)"
152152
def route_uri_pattern

actionpack/test/controller/routing_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ def test_route_uri_pattern
360360
"/:controller(/:action(/:id))(.:format)",
361361
controller.request.route_uri_pattern
362362
)
363+
364+
assert_equal(
365+
"/:controller(/:action(/:id))(.:format)",
366+
controller.request.get_header("action_dispatch.route_uri_pattern")
367+
)
363368
end
364369

365370
def test_route_with_colon_first

0 commit comments

Comments
 (0)