From 7487e79d4df7b05debb59e4177bc3810c29c9967 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Tue, 26 Feb 2013 11:50:48 -0500 Subject: Add tests for #9441 --- actionpack/test/controller/routing_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 5e821046db..93e94f0f48 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -456,6 +456,22 @@ class LegacyRouteSetTests < ActiveSupport::TestCase assert_equal("/", routes.send(:root_path)) end + def test_named_route_root_with_hash + rs.draw do + root "hello#index", as: :index + end + + routes = setup_for_named_route + assert_equal("http://test.host/", routes.send(:index_url)) + assert_equal("/", routes.send(:index_path)) + end + + def test_root_without_path_raises_argument_error + assert_raises ArgumentError do + rs.draw { root nil } + end + end + def test_named_route_root_with_trailing_slash rs.draw do root "hello#index" -- cgit v1.2.3