mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Fixed to_s bug with namespace routes (closes #10283) [johnb]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8216 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1012,7 +1012,7 @@ module ActionController
|
||||
path = "/#{path}" unless path[0] == ?/
|
||||
path = "#{path}/" unless path[-1] == ?/
|
||||
|
||||
path = "/#{options[:path_prefix].gsub(/^\//,'')}#{path}" if options[:path_prefix]
|
||||
path = "/#{options[:path_prefix].to_s.gsub(/^\//,'')}#{path}" if options[:path_prefix]
|
||||
|
||||
segments = segments_for_route_path(path)
|
||||
defaults, requirements, conditions = divide_route_options(segments, options)
|
||||
|
||||
@@ -1994,6 +1994,26 @@ class RouteSetTest < Test::Unit::TestCase
|
||||
assert_equal("index", request.path_parameters[:action])
|
||||
end
|
||||
|
||||
def test_setting_root_in_namespace_using_symbol
|
||||
assert_nothing_raised do
|
||||
set.draw do |map|
|
||||
map.namespace :admin do |admin|
|
||||
admin.root :controller => 'home'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_setting_root_in_namespace_using_string
|
||||
assert_nothing_raised do
|
||||
set.draw do |map|
|
||||
map.namespace 'admin' do |admin|
|
||||
admin.root :controller => 'home'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class RoutingTest < Test::Unit::TestCase
|
||||
|
||||
Reference in New Issue
Block a user