diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2013-02-26 11:50:48 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2013-02-26 11:50:48 -0500 |
commit | 7487e79d4df7b05debb59e4177bc3810c29c9967 (patch) | |
tree | 71da90125990f1da9e35a3f62419ff2ff0b3d2a6 /actionpack/test | |
parent | b1dee8c2535b2bca6ebe69d18c24d29f9ba19470 (diff) | |
download | rails-7487e79d4df7b05debb59e4177bc3810c29c9967.tar.gz rails-7487e79d4df7b05debb59e4177bc3810c29c9967.tar.bz2 rails-7487e79d4df7b05debb59e4177bc3810c29c9967.zip |
Add tests for #9441
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
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" |