diff options
author | James Coglan <jcoglan@gmail.com> | 2014-04-10 13:54:41 +0100 |
---|---|---|
committer | James Coglan <jcoglan@gmail.com> | 2014-04-10 13:54:41 +0100 |
commit | 77252c332e28dbc385a2e7865905bf3442972cf3 (patch) | |
tree | 4eafa3aacc4e72154994c89b27659e1f5d2a4b7e /actionpack/test | |
parent | d8d0fcb06aae164b57695749ee394eee6996ee4d (diff) | |
download | rails-77252c332e28dbc385a2e7865905bf3442972cf3.tar.gz rails-77252c332e28dbc385a2e7865905bf3442972cf3.tar.bz2 rails-77252c332e28dbc385a2e7865905bf3442972cf3.zip |
Add a failing test for a URL helper that was broken by a6b9ea2.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index ab2f0ec8de..f74a0ef945 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -1994,6 +1994,24 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest 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 |