diff options
author | Diego Carrion <dc.rec1@gmail.com> | 2011-10-10 19:53:42 -0300 |
---|---|---|
committer | Diego Carrion <dc.rec1@gmail.com> | 2011-10-10 19:53:42 -0300 |
commit | 8f863742e34908ed1a9549bb9f984edb58f2b068 (patch) | |
tree | 5d12c5aee476e3cf38653ab2147be131d9b32b7c /actionpack/test/dispatch | |
parent | fcb70f364ccb087f672a85d4d18cc79736503a13 (diff) | |
download | rails-8f863742e34908ed1a9549bb9f984edb58f2b068.tar.gz rails-8f863742e34908ed1a9549bb9f984edb58f2b068.tar.bz2 rails-8f863742e34908ed1a9549bb9f984edb58f2b068.zip |
allow shorthand routes with nested optional parameters
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index c0b74bc9f9..a71ac1bdc1 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -339,6 +339,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end scope '(:locale)', :locale => /en|pl/ do + get "registrations/new" resources :descriptions root :to => 'projects#index' end @@ -1471,6 +1472,16 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_nested_optional_path_shorthand + with_test_routes do + get '/registrations/new' + assert @request.params[:locale].nil? + + get '/en/registrations/new' + assert 'en', @request.params[:locale] + end + end + def test_default_params with_test_routes do get '/inline_pages' |