aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2013-02-26 11:50:48 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2013-02-26 11:50:48 -0500
commit7487e79d4df7b05debb59e4177bc3810c29c9967 (patch)
tree71da90125990f1da9e35a3f62419ff2ff0b3d2a6 /actionpack/test/controller
parentb1dee8c2535b2bca6ebe69d18c24d29f9ba19470 (diff)
downloadrails-7487e79d4df7b05debb59e4177bc3810c29c9967.tar.gz
rails-7487e79d4df7b05debb59e4177bc3810c29c9967.tar.bz2
rails-7487e79d4df7b05debb59e4177bc3810c29c9967.zip
Add tests for #9441
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/routing_test.rb16
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"