diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-08 23:26:51 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-08 23:26:51 +0200 |
commit | 5c9f27abaabba0d008ccd710ed1af5f6caa4e371 (patch) | |
tree | 9c388d2a9cdd238694656e9014217863fddfb9db | |
parent | 4560385fa4fa6925aa220bbaf6b2608c2bbd7039 (diff) | |
download | rails-5c9f27abaabba0d008ccd710ed1af5f6caa4e371.tar.gz rails-5c9f27abaabba0d008ccd710ed1af5f6caa4e371.tar.bz2 rails-5c9f27abaabba0d008ccd710ed1af5f6caa4e371.zip |
Add more cases to previous commit [#4394 state:resolved]
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 0f267caefe..7b79b6bde3 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -680,7 +680,7 @@ module ActionDispatch end def namespace(path) - if @scope[:scope_level] == :resources + if resource_scope? nested { super } else super diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index c4e402afd3..e13960e0dc 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -146,7 +146,11 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest resources :clients do namespace :google do - resource :account + resource :account do + namespace :secret do + resource :info + end + end end end @@ -824,8 +828,11 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest with_test_routes do get '/clients/1/google/account' assert_equal '/clients/1/google/account', client_google_account_path(1) - assert_equal 'google/accounts#show', @response.body + + get '/clients/1/google/account/secret/info' + assert_equal '/clients/1/google/account/secret/info', client_google_account_secret_info_path(1) + assert_equal 'google/secret/infos#show', @response.body end end |