Permalink
Browse files

Merge pull request #12337 from rubys/route-formatter-test

add test_scoped_root_as_name
  • Loading branch information...
2 parents 4ad58af + ac1613e commit 3f79a7716d195d8b3196b3d29e0e29ba539fe9d4 @rafaelfranca rafaelfranca committed Sep 24, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 actionpack/test/dispatch/routing_test.rb
@@ -1102,6 +1102,19 @@ def test_scoped_root
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

0 comments on commit 3f79a77

Please sign in to comment.