mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add failing test for #13369
After introducing 50311f1
a regression was introduced: routes with
trailing slash are no longer recognized properly. This commit provides a
failing test for this situation.
This commit is contained in:
parent
2a0ba918c4
commit
73d8a90bee
1 changed files with 18 additions and 0 deletions
|
@ -2894,6 +2894,24 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
|
|||
assert_equal '/foo', foo_root_path
|
||||
end
|
||||
|
||||
def test_trailing_slash
|
||||
draw do
|
||||
resources :streams
|
||||
end
|
||||
|
||||
get '/streams'
|
||||
assert @response.ok?, 'route without trailing slash should work'
|
||||
|
||||
get '/streams/'
|
||||
assert @response.ok?, 'route with trailing slash should work'
|
||||
|
||||
get '/streams?foobar'
|
||||
assert @response.ok?, 'route without trailing slash and with QUERY_STRING should work'
|
||||
|
||||
get '/streams/?foobar'
|
||||
assert @response.ok?, 'route with trailing slash and with QUERY_STRING should work'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def draw(&block)
|
||||
|
|
Loading…
Reference in a new issue