From 73d8a90bee79106c965ad35151870941ab38d951 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 16 Jan 2014 10:07:51 +0100 Subject: 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. --- actionpack/test/dispatch/routing_test.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'actionpack/test') 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) -- cgit v1.2.3 From 2e0f9ed76eed8132ce49e672694a3d53baf38b6f Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 16 Jan 2014 10:13:05 +0100 Subject: Revert "Don't remove trailing slash from PATH_INFO for mounted apps" The revert is needed because of a regression described in #13369, routes with trailing slash are no longer recognized properly. This reverts commit 50311f1391ddd8e0349d74eb57f04b7e0045a27d. --- actionpack/test/dispatch/mount_test.rb | 5 ----- 1 file changed, 5 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/mount_test.rb b/actionpack/test/dispatch/mount_test.rb index 683a4f01e2..cdf00d84fb 100644 --- a/actionpack/test/dispatch/mount_test.rb +++ b/actionpack/test/dispatch/mount_test.rb @@ -44,11 +44,6 @@ class TestRoutingMount < ActionDispatch::IntegrationTest "A named route should be defined with a parent's prefix" end - def test_trailing_slash_is_not_removed_from_path_info - get "/sprockets/omg/" - assert_equal "/sprockets -- /omg/", response.body - end - def test_mounting_sets_script_name get "/sprockets/omg" assert_equal "/sprockets -- /omg", response.body -- cgit v1.2.3