From 494d2c631bbfacd6d67c5c502422c2502c2fcd3a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 15 Sep 2007 20:38:39 +0000 Subject: root_path returns '/' not ''. Closes #9563. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7482 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/routing_test.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'actionpack/test/controller/routing_test.rb') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 4901c93a60..fee1ad3ccf 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -218,7 +218,16 @@ class LegacyRouteSetTests < Test::Unit::TestCase map.normal ':controller/:action/:id' end end - + + def test_named_route_root + rs.draw do |map| + map.root :controller => "hello" + end + x = setup_for_named_route + assert_equal("http://named.route.test", x.send(:root_url)) + assert_equal("/", x.send(:root_path)) + end + def test_named_route_with_regexps rs.draw do |map| map.article 'page/:year/:month/:day/:title', :controller => 'page', :action => 'show', -- cgit v1.2.3