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/dispatch/routing_test.rb') 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