Skip to content
Browse files

Add test to prevent regression on namespace root nested in a resource

[#6389 state:resolved]
  • Loading branch information...
1 parent 64ca278 commit abea073ddaf260525aa5158e0d375c839c43ca3d @pixeltrix pixeltrix committed Feb 14, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 actionpack/test/dispatch/routing_test.rb
View
9 actionpack/test/dispatch/routing_test.rb
@@ -171,6 +171,9 @@ def self.matches?(request)
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
@@ -2237,6 +2240,12 @@ def test_nested_route_in_nested_resource
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

0 comments on commit abea073

Please sign in to comment.
Something went wrong with that request. Please try again.