From 4560385fa4fa6925aa220bbaf6b2608c2bbd7039 Mon Sep 17 00:00:00 2001 From: Jan De Poorter Date: Wed, 14 Apr 2010 10:34:42 +0200 Subject: Make sure namespaces are nested within resources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- actionpack/test/dispatch/routing_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'actionpack/test/dispatch') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 5c46f9b971..c4e402afd3 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -144,6 +144,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest resources :sheep + resources :clients do + namespace :google do + resource :account + end + end + match 'sprockets.js' => ::TestRoutingMapper::SprocketsApp match 'people/:id/update', :to => 'people#update', :as => :update_person @@ -813,6 +819,15 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal '/account/admin/subscription', account_admin_subscription_path end end + + 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 + end + end def test_articles_with_id with_test_routes do -- cgit v1.2.3