From ac1613e5dfc4c789049f5c4c02f6cc384aa1030b Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Tue, 24 Sep 2013 09:45:36 -0400 Subject: add test_scoped_root_as_name test for regression introduced by https://github.com/rails/rails/pull/9155 --- actionpack/test/dispatch/routing_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- cgit v1.2.3