diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-03-02 17:20:13 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-03-03 15:49:52 -0800 |
commit | bcfb77782b9d7f28f0c19005da909162e5e27690 (patch) | |
tree | 136ab5091182ae2b927d31f9a5453b050d647925 /actionpack/test/controller/url_for_test.rb | |
parent | 664090348154ccbf1274a13bbc3d3c37ba35bc7d (diff) | |
download | rails-bcfb77782b9d7f28f0c19005da909162e5e27690.tar.gz rails-bcfb77782b9d7f28f0c19005da909162e5e27690.tar.bz2 rails-bcfb77782b9d7f28f0c19005da909162e5e27690.zip |
Work on deprecating ActionController::Base.relative_url_root
Diffstat (limited to 'actionpack/test/controller/url_for_test.rb')
-rw-r--r-- | actionpack/test/controller/url_for_test.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb index a7b77edc6e..07809aa480 100644 --- a/actionpack/test/controller/url_for_test.rb +++ b/actionpack/test/controller/url_for_test.rb @@ -113,15 +113,13 @@ module AbstractController end def test_relative_url_root_is_respected - orig_relative_url_root = ActionController::Base.relative_url_root - ActionController::Base.relative_url_root = '/subdir' + # ROUTES TODO: Tests should not have to pass :relative_url_root directly. This + # should probably come from the router. add_host! assert_equal('https://www.basecamphq.com/subdir/c/a/i', - W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => 'https') + W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => 'https', :relative_url_root => '/subdir') ) - ensure - ActionController::Base.relative_url_root = orig_relative_url_root end def test_named_routes @@ -146,9 +144,6 @@ module AbstractController end def test_relative_url_root_is_respected_for_named_routes - orig_relative_url_root = ActionController::Base.relative_url_root - ActionController::Base.relative_url_root = '/subdir' - with_routing do |set| set.draw do |map| match '/home/sweet/home/:user', :to => 'home#index', :as => :home @@ -158,10 +153,8 @@ module AbstractController controller = kls.new assert_equal 'http://www.basecamphq.com/subdir/home/sweet/home/again', - controller.send(:home_url, :host => 'www.basecamphq.com', :user => 'again') + controller.send(:home_url, :host => 'www.basecamphq.com', :user => 'again', :relative_url_root => "/subdir") end - ensure - ActionController::Base.relative_url_root = orig_relative_url_root end def test_only_path |