aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2014-01-16 10:07:51 +0100
committerPiotr Sarnacki <drogus@gmail.com>2014-01-16 10:13:40 +0100
commit73d8a90bee79106c965ad35151870941ab38d951 (patch)
treede3a96f2b9ca4d9648c2bd3b1f819fbe114049ea /actionpack/test/dispatch/routing_test.rb
parent2a0ba918c4fc085888bde29b6662aec03c204d89 (diff)
downloadrails-73d8a90bee79106c965ad35151870941ab38d951.tar.gz
rails-73d8a90bee79106c965ad35151870941ab38d951.tar.bz2
rails-73d8a90bee79106c965ad35151870941ab38d951.zip
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.
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 5a532dc38f..795911497e 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -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)