diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2005-07-14 10:32:37 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2005-07-14 10:32:37 +0000 |
commit | bf0b7588ee4e32353e0dc10c2d1c3d2b9ea952c4 (patch) | |
tree | fd60c9c5a207eb5012679ca23b4d2a33a15102ae /actionpack/test/controller | |
parent | 6ed16ff60290620c87772670d312585f2431d03f (diff) | |
download | rails-bf0b7588ee4e32353e0dc10c2d1c3d2b9ea952c4.tar.gz rails-bf0b7588ee4e32353e0dc10c2d1c3d2b9ea952c4.tar.bz2 rails-bf0b7588ee4e32353e0dc10c2d1c3d2b9ea952c4.zip |
Add RouteSet#named_route so that RouteSet instance methods do not shadow available route names
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1834 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index c0bc92f6db..23d741a58f 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -862,6 +862,18 @@ class RouteSetTests < Test::Unit::TestCase assert_equal ['/content/hi', {}], rs.generate({:controller => 'content', :action => 'hi'}) end end + + def test_named_route_method + rs.draw do + assert_raises(ArgumentError) { rs.categories 'categories', :controller => 'content', :action => 'categories' } + + rs.named_route :categories, 'categories', :controller => 'content', :action => 'categories' + rs.connect ':controller/:action/:id' + end + + assert_equal ['/categories', {}], rs.generate(:controller => 'content', :action => 'categories') + assert_equal ['/content/hi', {}], rs.generate({:controller => 'content', :action => 'hi'}) + end end |