aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/routing_test.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-09-17 09:30:18 +0000
committerMichael Koziarski <michael@koziarski.com>2007-09-17 09:30:18 +0000
commit7cb26b5d2d0ecb4945f01b1aa1d398eb85c9f1a4 (patch)
tree24f361b1f6e4e6738ebb71344dcb61f0ac2f50fa /actionpack/test/controller/routing_test.rb
parentacbec3e565909da5811488e88066a01f71b68a94 (diff)
downloadrails-7cb26b5d2d0ecb4945f01b1aa1d398eb85c9f1a4.tar.gz
rails-7cb26b5d2d0ecb4945f01b1aa1d398eb85c9f1a4.tar.bz2
rails-7cb26b5d2d0ecb4945f01b1aa1d398eb85c9f1a4.zip
Disable optimisation code for UrlWriter as request.host doesn't make sense there.
Don't try to use the .to_query method when the route has no dynamic segments. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7501 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/routing_test.rb')
-rw-r--r--actionpack/test/controller/routing_test.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index 793e1d8cdf..c7b7f40e0d 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -189,7 +189,7 @@ class LegacyRouteSetTests < Test::Unit::TestCase
end
def test_named_route_with_nested_controller
- rs.add_named_route :users, 'admin/user', :controller => '/admin/user', :action => 'index'
+ rs.add_named_route :users, '/admin/user', :controller => '/admin/user', :action => 'index'
x = setup_for_named_route
assert_equal("http://named.route.test/admin/user",
x.send(:users_url))
@@ -198,12 +198,13 @@ class LegacyRouteSetTests < Test::Unit::TestCase
uses_mocha "named route optimisation" do
def test_optimised_named_route_call_never_uses_url_for
rs.add_named_route :users, 'admin/user', :controller => '/admin/user', :action => 'index'
+ 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_path)
- x.send(:users_url, :some_arg=>"some_value")
- x.send(:users_path, :some_arg=>"some_value")
+ x.send(:user_url, 2, :foo=>"bar")
+ x.send(:user_path, 3, :bar=>"foo")
end
end