diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2011-02-14 02:56:09 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2011-02-14 02:56:09 +0000 |
commit | 460a341682518f554f5466a7b010c2bc51875060 (patch) | |
tree | 97569a8e8b72ffcc9bba5a6de35a7dd4ae5b223e /actionpack/test/dispatch | |
parent | fd7605826a6e4f7590e4abf42c6c9d0923afc4ef (diff) | |
download | rails-460a341682518f554f5466a7b010c2bc51875060.tar.gz rails-460a341682518f554f5466a7b010c2bc51875060.tar.bz2 rails-460a341682518f554f5466a7b010c2bc51875060.zip |
Fix named route helper for routes nested inside deeply nested resources
[#6416 state:resolved]
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index bdd4606720..b38933095c 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -187,7 +187,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end resources :posts, :only => [:index, :show] do - resources :comments, :except => :destroy + resources :comments, :except => :destroy do + get "views" => "comments#views", :as => :views + end end resource :past, :only => :destroy @@ -2308,6 +2310,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_nested_route_in_nested_resource + get "/posts/1/comments/2/views" + assert_equal "comments#views", @response.body + assert_equal "/posts/1/comments/2/views", post_comment_views_path(:post_id => '1', :comment_id => '2') + end + private def with_test_routes yield |