From d5f4cac68c069a3caff1712fd967ed70a4eb52da Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Tue, 26 Mar 2013 12:14:21 +0100 Subject: bugfix, when matching multiple paths with `get`, `post`, ... This problem was introduced with: https://github.com/rails/rails/commit/d03aa104e069be4e301efa8cefb90a2a785a7bff --- actionpack/test/dispatch/routing_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'actionpack/test/dispatch') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index df359ba77d..6dde183222 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -1112,6 +1112,21 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal 'projects#info', @response.body end + def test_match_with_many_paths_containing_a_slash + draw do + get 'get/first', 'get/second', 'get/third', :to => 'get#show' + end + + get '/get/first' + assert_equal 'get#show', @response.body + + get '/get/second' + assert_equal 'get#show', @response.body + + get '/get/third' + assert_equal 'get#show', @response.body + end + def test_match_shorthand_with_no_scope draw do get 'account/overview' -- cgit v1.2.3 From 69e87f5994f74eef02fdfd7912ae81a334d74218 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Tue, 26 Mar 2013 12:19:46 +0100 Subject: routing shorthand syntax works with multiple paths Closes #9913. We need to expand the match shorthand syntax for every path. --- actionpack/test/dispatch/routing_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'actionpack/test/dispatch') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 6dde183222..6eb9d019df 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -1149,6 +1149,20 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal 'account#shorthand', @response.body end + def test_match_shorthand_with_multiple_paths_inside_namespace + draw do + namespace :proposals do + put 'activate', 'inactivate' + end + end + + put '/proposals/activate' + assert_equal 'proposals#activate', @response.body + + put '/proposals/inactivate' + assert_equal 'proposals#inactivate', @response.body + end + def test_match_shorthand_inside_namespace_with_controller draw do namespace :api do -- cgit v1.2.3