Permalink
Browse files

Add a failing test for a URL helper that was broken by a6b9ea2.

  • Loading branch information...
1 parent d8d0fcb commit 77252c332e28dbc385a2e7865905bf3442972cf3 @jcoglan jcoglan committed Apr 10, 2014
Showing with 18 additions and 0 deletions.
  1. +18 −0 actionpack/test/dispatch/routing_test.rb
@@ -1994,6 +1994,24 @@ def test_shallow_nested_resources_inside_resource
assert_equal 'cards#destroy', @response.body
end
+ def test_shallow_deeply_nested_resources
+ draw do
+ resources :blogs do
+ resources :posts do
+ resources :comments, shallow: true
+ end
+ end
+ end
+
+ get '/comments/1'
+ assert_equal 'comments#show', @response.body
+
+ assert_equal '/comments/1', comment_path('1')
+ assert_equal '/blogs/new', new_blog_path
+ assert_equal '/blogs/1/posts/new', new_blog_post_path(:blog_id => 1)
+ assert_equal '/blogs/1/posts/2/comments/new', new_blog_post_comment_path(:blog_id => 1, :post_id => 2)
+ end
+
def test_shallow_nested_resources_within_scope
draw do
scope '/hello' do

0 comments on commit 77252c3

Please sign in to comment.