diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-11-20 21:25:25 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-11-20 21:25:25 +0000 |
commit | 0c12d6c6dc66cb7873969fc7f982ad9244a4ea00 (patch) | |
tree | 6b375f5db19b2323b3f67b0204c2658f5f271851 /actionpack/test/controller/routing_test.rb | |
parent | e1a2f3c898be4048f00eb6e8909f63da0116789a (diff) | |
download | rails-0c12d6c6dc66cb7873969fc7f982ad9244a4ea00.tar.gz rails-0c12d6c6dc66cb7873969fc7f982ad9244a4ea00.tar.bz2 rails-0c12d6c6dc66cb7873969fc7f982ad9244a4ea00.zip |
Ensure that the routing optimisation code isn't used when additional arguments are passed to the named route. Closes #10209 [bscofield, Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8169 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, 10 insertions, 2 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index f2bd9f4301..5198efd8e6 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -212,11 +212,19 @@ class LegacyRouteSetTests < Test::Unit::TestCase rs.add_named_route :user, 'admin/user/:id', :controller=>'/admin/user', :action=>'show' x = setup_for_named_route x.expects(:url_for).never - # x.send(:users_url) + x.send(:users_url) x.send(:users_path) - # x.send(:user_url, 2, :foo=>"bar") + x.send(:user_url, 2, :foo=>"bar") x.send(:user_path, 3, :bar=>"foo") end + + def test_optimized_named_route_with_host + rs.add_named_route :pages, 'pages', :controller => 'content', :action => 'show_page', :host => 'foo.com' + x = setup_for_named_route + x.expects(:url_for).with(:host => 'foo.com', :only_path => false, :controller => 'content', :action => 'show_page', :use_route => :pages).once + x.send(:pages_url) + end + end def setup_for_named_route |