From 86defed5ad6c1ec95b2f07a93982a514e2347749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 12 Apr 2010 20:23:35 +0200 Subject: Fix a bug in url generation for generic routes. --- actionpack/test/dispatch/routing_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index d32d708b35..8940990712 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -197,6 +197,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest resource :me match '/' => 'mes#index' end + + match "whatever/:controller(/:action(/:id))" end end @@ -979,6 +981,16 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_url_generator_for_generic_route + with_test_routes do + get 'whatever/foo/bar' + assert_equal 'foo#bar', @response.body + + assert_equal 'http://www.example.com/whatever/foo/bar/1', + url_for(:controller => "foo", :action => "bar", :id => 1) + end + end + private def with_test_routes yield -- cgit v1.2.3