Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add more cases to previous commit [#4394 state:resolved]
  • Loading branch information
josevalim committed Jun 8, 2010
1 parent 4560385 commit 5c9f27a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/routing/mapper.rb
Expand Up @@ -680,7 +680,7 @@ def nested
end

def namespace(path)
if @scope[:scope_level] == :resources
if resource_scope?
nested { super }
else
super
Expand Down
11 changes: 9 additions & 2 deletions actionpack/test/dispatch/routing_test.rb
Expand Up @@ -146,7 +146,11 @@ def self.matches?(request)

resources :clients do
namespace :google do
resource :account
resource :account do
namespace :secret do
resource :info
end
end
end
end

Expand Down Expand Up @@ -824,8 +828,11 @@ def test_namespace_nested_in_resources
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

Expand Down

0 comments on commit 5c9f27a

Please sign in to comment.