Fixed a globbed route issue where slashes were being escaped, causing assert_routing to fail. [#5135 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
d16c5cc99b
commit
622092d33e
@ -414,7 +414,8 @@ def opts
|
||||
elsif value.is_a?(Array)
|
||||
value.map { |v| Rack::Mount::Utils.escape_uri(v.to_param) }.join('/')
|
||||
else
|
||||
Rack::Mount::Utils.escape_uri(value.to_param)
|
||||
return nil unless param = value.to_param
|
||||
param.split('/').map { |v| Rack::Mount::Utils.escape_uri(v) }.join("/")
|
||||
end
|
||||
end
|
||||
{:parameterize => parameterize}
|
||||
|
@ -461,6 +461,13 @@ def test_assert_routing_with_method
|
||||
def test_assert_routing_in_module
|
||||
assert_routing 'admin/user', :controller => 'admin/user', :action => 'index'
|
||||
end
|
||||
|
||||
def test_assert_routing_with_glob
|
||||
with_routing do |set|
|
||||
set.draw { |map| match('*path' => "pages#show") }
|
||||
assert_routing('/company/about', { :controller => 'pages', :action => 'show', :path => 'company/about' })
|
||||
end
|
||||
end
|
||||
|
||||
def test_params_passing
|
||||
get :test_params, :page => {:name => "Page name", :month => '4', :year => '2004', :day => '6'}
|
||||
|
Loading…
Reference in New Issue
Block a user