diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-24 14:13:49 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-24 14:13:49 -0300 |
commit | 3f79a7716d195d8b3196b3d29e0e29ba539fe9d4 (patch) | |
tree | e1ad9730fcdacd121aa6fe871a8990796ace2412 | |
parent | 4ad58af563675cd737f68c7eb2f7184e3813513b (diff) | |
parent | ac1613e5dfc4c789049f5c4c02f6cc384aa1030b (diff) | |
download | rails-3f79a7716d195d8b3196b3d29e0e29ba539fe9d4.tar.gz rails-3f79a7716d195d8b3196b3d29e0e29ba539fe9d4.tar.bz2 rails-3f79a7716d195d8b3196b3d29e0e29ba539fe9d4.zip |
Merge pull request #12337 from rubys/route-formatter-test
add test_scoped_root_as_name
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index e4c3ddd3f9..3e9e90a950 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -1102,6 +1102,19 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal 'projects#index', @response.body end + def test_scoped_root_as_name + draw do + scope '(:locale)', :locale => /en|pl/ do + root :to => 'projects#index', :as => 'projects' + end + end + + assert_equal '/en', projects_path(:locale => 'en') + assert_equal '/', projects_path + get '/en' + assert_equal 'projects#index', @response.body + end + def test_scope_with_format_option draw do get "direct/index", as: :no_format_direct, format: false |