aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/routing_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/routing_test.rb')
-rw-r--r--actionpack/test/controller/routing_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index 55cf5d8e94..1243b0a6a9 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -682,6 +682,17 @@ class RouteSetTests < Test::Unit::TestCase
{:controller => 'admin/user', :action => 'index'}
)
end
+
+ def test_backwards
+ rs.draw do |map|
+ rs.connect 'page/:id/:action', :controller => 'pages', :action => 'show'
+ rs.connect ':controller/:action/:id'
+ end
+
+ assert_equal ['/page/20', {}], rs.generate(:controller => 'pages', :id => 20)
+ assert_equal ['/page/20', {}], rs.generate(:controller => 'pages', :id => 20, :action => 'show')
+ assert_equal ['/pages/boo', {}], rs.generate(:controller => 'pages', :action => 'boo')
+ end
end
end