Permalink
Browse files

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.
  • Loading branch information...
1 parent 2a0ba91 commit 73d8a90bee79106c965ad35151870941ab38d951 @drogus drogus committed Jan 16, 2014
Showing with 18 additions and 0 deletions.
  1. +18 −0 actionpack/test/dispatch/routing_test.rb
@@ -2894,6 +2894,24 @@ def test_absolute_controller_namespace
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)

0 comments on commit 73d8a90

Please sign in to comment.