diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-07 14:16:05 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-07 14:16:05 +0000 |
commit | 75157bbf64571548983892e62fab5789e9ab06d0 (patch) | |
tree | 30755f6574a4f54eb3e528163ca75d16793fabc1 /actionpack/test/controller/routing_test.rb | |
parent | afbf54bc3dc8f9d1aeb670d927097a46e78c1515 (diff) | |
download | rails-75157bbf64571548983892e62fab5789e9ab06d0.tar.gz rails-75157bbf64571548983892e62fab5789e9ab06d0.tar.bz2 rails-75157bbf64571548983892e62fab5789e9ab06d0.zip |
Fixed that named routes didn't use the default values for action and possible other parameters #1534 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1758 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/routing_test.rb')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 3b3cee6ae6..48151ba198 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -661,7 +661,17 @@ class RouteSetTests < Test::Unit::TestCase x = setup_for_named_route assert_equal({:controller => '/content', :action => 'show_page', :title => 'new stuff'}, x.new.send(:page_url, :title => 'new stuff')) - end + end + + def test_named_route_with_default + rs.page 'page/:title', :controller => 'content', :action => 'show_page', :title => 'AboutPage' + x = setup_for_named_route + assert_equal({:controller => '/content', :action => 'show_page', :title => 'AboutPage'}, + x.new.send(:page_url)) + assert_equal({:controller => '/content', :action => 'show_page', :title => 'AboutRails'}, + x.new.send(:page_url, :title => "AboutRails")) + + end def setup_for_named_route x = Class.new |