aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/routing_test.rb12
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