Permalink
Browse files

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>
  • Loading branch information...
1 parent d16c5cc commit 622092d33e8d326217ab1ed6138e2c572c95b8ba @heimidal heimidal committed with josevalim Jul 16, 2010
Showing with 9 additions and 1 deletion.
  1. +2 −1 actionpack/lib/action_dispatch/routing/route_set.rb
  2. +7 −0 actionpack/test/controller/test_test.rb
@@ -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'}

0 comments on commit 622092d

Please sign in to comment.