Skip to content
This repository
Browse code

Add more cases to previous commit [#4394 state:resolved]

  • Loading branch information...
commit 5c9f27abaabba0d008ccd710ed1af5f6caa4e371 1 parent 4560385
José Valim josevalim authored
2  actionpack/lib/action_dispatch/routing/mapper.rb
@@ -680,7 +680,7 @@ def nested
680 680 end
681 681
682 682 def namespace(path)
683   - if @scope[:scope_level] == :resources
  683 + if resource_scope?
684 684 nested { super }
685 685 else
686 686 super
11 actionpack/test/dispatch/routing_test.rb
@@ -146,7 +146,11 @@ def self.matches?(request)
146 146
147 147 resources :clients do
148 148 namespace :google do
149   - resource :account
  149 + resource :account do
  150 + namespace :secret do
  151 + resource :info
  152 + end
  153 + end
150 154 end
151 155 end
152 156
@@ -824,8 +828,11 @@ def test_namespace_nested_in_resources
824 828 with_test_routes do
825 829 get '/clients/1/google/account'
826 830 assert_equal '/clients/1/google/account', client_google_account_path(1)
827   -
828 831 assert_equal 'google/accounts#show', @response.body
  832 +
  833 + get '/clients/1/google/account/secret/info'
  834 + assert_equal '/clients/1/google/account/secret/info', client_google_account_secret_info_path(1)
  835 + assert_equal 'google/secret/infos#show', @response.body
829 836 end
830 837 end
831 838

0 comments on commit 5c9f27a

Please sign in to comment.
Something went wrong with that request. Please try again.