From 2cc9c8135c57671013a0b89fd683654cb6782676 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Sun, 28 Jan 2007 17:29:51 +0000 Subject: Allow Routes to generate all urls for a set of options by specifying :generate_all => true. References #1739. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6082 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/routing_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 2c59217868..0c8628fbf7 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -1719,6 +1719,20 @@ class RouteSetTest < Test::Unit::TestCase ) end + def test_generate_all + set.draw do |map| + map.connect 'show_post/:id', :controller => 'post', :action => 'show' + map.connect ':controller/:action/:id' + end + all = set.generate( + {:action => 'show', :id => 10, :generate_all => true}, + {:controller => 'post', :action => 'show'} + ) + assert_equal 2, all.length + assert_equal '/show_post/10', all.first + assert_equal '/post/show/10', all.last + end + end class RoutingTest < Test::Unit::TestCase -- cgit v1.2.3