diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-09-17 09:30:18 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-09-17 09:30:18 +0000 |
commit | 7cb26b5d2d0ecb4945f01b1aa1d398eb85c9f1a4 (patch) | |
tree | 24f361b1f6e4e6738ebb71344dcb61f0ac2f50fa /actionpack/test/controller/url_rewriter_test.rb | |
parent | acbec3e565909da5811488e88066a01f71b68a94 (diff) | |
download | rails-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/url_rewriter_test.rb')
-rw-r--r-- | actionpack/test/controller/url_rewriter_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb index a49aaa822a..3c1d584d89 100644 --- a/actionpack/test/controller/url_rewriter_test.rb +++ b/actionpack/test/controller/url_rewriter_test.rb @@ -151,6 +151,7 @@ class UrlWriterTests < Test::Unit::TestCase def test_named_route ActionController::Routing::Routes.draw do |map| + map.no_args '/this/is/verbose', :controller => 'home', :action => 'index' map.home '/home/sweet/home/:user', :controller => 'home', :action => 'index' map.connect ':controller/:action/:id' end @@ -163,6 +164,8 @@ class UrlWriterTests < Test::Unit::TestCase controller.send(:home_url, :host => 'www.basecamphq.com', :user => 'again') assert_equal("/home/sweet/home/alabama", controller.send(:home_path, :user => 'alabama', :host => 'unused')) + assert_equal("http://www.basecamphq.com/home/sweet/home/alabama", controller.send(:home_url, :user => 'alabama', :host => 'www.basecamphq.com')) + assert_equal("http://www.basecamphq.com/this/is/verbose", controller.send(:no_args_url, :host=>'www.basecamphq.com')) ensure ActionController::Routing::Routes.load! end @@ -181,6 +184,7 @@ class UrlWriterTests < Test::Unit::TestCase controller.send(:url_for, :controller => 'brave', :action => 'new', :id => 'world', :only_path => true) assert_equal("/home/sweet/home/alabama", controller.send(:home_url, :user => 'alabama', :host => 'unused', :only_path => true)) + assert_equal("/home/sweet/home/alabama", controller.send(:home_path, 'alabama')) ensure ActionController::Routing::Routes.load! end |