diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2010-06-19 12:53:09 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-20 00:15:48 +0200 |
commit | 1f84061c5c271647dc5f7f1311e365e134130e0f (patch) | |
tree | 4cbcdd8a032ad9e3ceceaac528d84e02870c8aef /actionpack/test/dispatch | |
parent | ed3f042e99949526f483d1f567e40031deea33d3 (diff) | |
download | rails-1f84061c5c271647dc5f7f1311e365e134130e0f.tar.gz rails-1f84061c5c271647dc5f7f1311e365e134130e0f.tar.bz2 rails-1f84061c5c271647dc5f7f1311e365e134130e0f.zip |
Don't use module to work out shallow name prefix and path as it may not accurately reflect the actual namespace [#4899 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index c4cdc4b2a8..495255c22b 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -278,8 +278,11 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest resource :dashboard, :constraints => { :ip => /192\.168\.1\.\d{1,3}/ } - scope :module => 'api' do + scope :module => :api do resource :token + resources :errors, :shallow => true do + resources :notices + end end scope :path => 'api' do @@ -1350,6 +1353,18 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_shallow_nested_routes_ignore_module + with_test_routes do + get '/errors/1/notices' + assert_equal 'api/notices#index', @response.body + assert_equal '/errors/1/notices', error_notices_path(:error_id => '1') + + get '/notices/1' + assert_equal 'api/notices#show', @response.body + assert_equal '/notices/1', notice_path(:id => '1') + end + end + private def with_test_routes yield |