Skip to content
Browse files

Add tests for #9441

  • Loading branch information...
1 parent b1dee8c commit 7487e79d4df7b05debb59e4177bc3810c29c9967 Francesco Rodriguez committed Feb 26, 2013
Showing with 16 additions and 0 deletions.
  1. +16 −0 actionpack/test/controller/routing_test.rb
View
16 actionpack/test/controller/routing_test.rb
@@ -456,6 +456,22 @@ def test_named_route_root_without_hash
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"

0 comments on commit 7487e79

Please sign in to comment.
Something went wrong with that request. Please try again.