From ccc678b49e48bac37a78f6b542e9def58f4b71d8 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 14 Feb 2011 06:12:22 +0000 Subject: Add test to prevent regression on namespace root nested in a resource [#6389 state:resolved] --- actionpack/test/dispatch/routing_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test/dispatch') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index b38933095c..1a96587836 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -187,6 +187,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end resources :posts, :only => [:index, :show] do + namespace :admin do + root :to => "index#index" + end resources :comments, :except => :destroy do get "views" => "comments#views", :as => :views end @@ -2316,6 +2319,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal "/posts/1/comments/2/views", post_comment_views_path(:post_id => '1', :comment_id => '2') end + def test_root_in_deeply_nested_scope + get "/posts/1/admin" + assert_equal "admin/index#index", @response.body + assert_equal "/posts/1/admin", post_admin_root_path(:post_id => '1') + end + private def with_test_routes yield -- cgit v1.2.3