aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-10-10 23:57:03 -0700
committerJosé Valim <jose.valim@gmail.com>2011-10-10 23:57:03 -0700
commit1735868c61bc9925f8fabdaea4c44e4b5962b8f4 (patch)
tree51ef0babbf3913c361a41cef963239c38742bff8 /actionpack/test/dispatch/routing_test.rb
parentb5f66cf7ebfafefc27ee8c62ce39fee4c044eee7 (diff)
parent8f863742e34908ed1a9549bb9f984edb58f2b068 (diff)
downloadrails-1735868c61bc9925f8fabdaea4c44e4b5962b8f4.tar.gz
rails-1735868c61bc9925f8fabdaea4c44e4b5962b8f4.tar.bz2
rails-1735868c61bc9925f8fabdaea4c44e4b5962b8f4.zip
Merge pull request #3285 from dcrec1/master
Fixes #3280: Shorthand route nested in scope produces missing controller error
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb11
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'