diff options
author | Jamis Buck <jamis@37signals.com> | 2005-07-05 15:06:09 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-07-05 15:06:09 +0000 |
commit | 3b1d271e02e3f5b468b2a1ed3fc2a8bd2f228bd4 (patch) | |
tree | bd828a6e46c74275f8ff8a24d26bbc0dddf62a29 /actionpack/test | |
parent | 870cca6829cca8a2303bdcf2cbefde3c1ffbca5a (diff) | |
download | rails-3b1d271e02e3f5b468b2a1ed3fc2a8bd2f228bd4.tar.gz rails-3b1d271e02e3f5b468b2a1ed3fc2a8bd2f228bd4.tar.bz2 rails-3b1d271e02e3f5b468b2a1ed3fc2a8bd2f228bd4.zip |
Routing fix
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1712 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 11 |
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 |