aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/routing_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/routing_test.rb')
-rw-r--r--actionpack/test/controller/routing_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index 5198efd8e6..1036d7f3bf 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -1980,6 +1980,20 @@ class RouteSetTest < Test::Unit::TestCase
assert_equal '/post/show/10', all.last
end
+ def test_named_route_in_nested_resource
+ set.draw do |map|
+ map.resources :projects do |project|
+ project.comments 'comments', :controller => 'comments', :action => 'index'
+ end
+ end
+
+ request.path = "/projects/1/comments"
+ request.method = :get
+ assert_nothing_raised { set.recognize(request) }
+ assert_equal("comments", request.path_parameters[:controller])
+ assert_equal("index", request.path_parameters[:action])
+ end
+
end
class RoutingTest < Test::Unit::TestCase