diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-02-26 08:55:48 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-02-26 08:55:48 -0800 |
commit | 3d9cfe09ade284f6c99e45d6d44623c2574d9947 (patch) | |
tree | 41725e247039c3350cbbe0e24611d56fec40307c | |
parent | 0f75e2c51fe7d9ee9e27a792065803bfc95a5a36 (diff) | |
parent | 7487e79d4df7b05debb59e4177bc3810c29c9967 (diff) | |
download | rails-3d9cfe09ade284f6c99e45d6d44623c2574d9947.tar.gz rails-3d9cfe09ade284f6c99e45d6d44623c2574d9947.tar.bz2 rails-3d9cfe09ade284f6c99e45d6d44623c2574d9947.zip |
Merge pull request #9444 from frodsan/add_test_for_977455cc
Add tests for #9441
-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" |