aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2011-02-14 06:12:22 +0000
committerAndrew White <andyw@pixeltrix.co.uk>2011-02-14 06:12:22 +0000
commitccc678b49e48bac37a78f6b542e9def58f4b71d8 (patch)
tree1f38b496e39f5e5fa5e341f90d8b559bc74be715 /actionpack/test
parent460a341682518f554f5466a7b010c2bc51875060 (diff)
downloadrails-ccc678b49e48bac37a78f6b542e9def58f4b71d8.tar.gz
rails-ccc678b49e48bac37a78f6b542e9def58f4b71d8.tar.bz2
rails-ccc678b49e48bac37a78f6b542e9def58f4b71d8.zip
Add test to prevent regression on namespace root nested in a resource
[#6389 state:resolved]
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/routing_test.rb9
1 files changed, 9 insertions, 0 deletions
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