aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/url_for_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/url_for_test.rb')
-rw-r--r--actionpack/test/controller/url_for_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb
index 0ffa2d2a03..cd63493b32 100644
--- a/actionpack/test/controller/url_for_test.rb
+++ b/actionpack/test/controller/url_for_test.rb
@@ -255,6 +255,16 @@ module AbstractController
)
end
+ def test_relative_url_root_is_respected_with_environment_variable
+ # `config.relative_url_root` is set by ENV['RAILS_RELATIVE_URL_ROOT']
+ ActionDispatch::Routing::RouteSet.relative_url_root = '/subdir'
+ add_host!
+ assert_equal('https://www.basecamphq.com/subdir/c/a/i',
+ W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => 'https')
+ )
+ ActionDispatch::Routing::RouteSet.relative_url_root = nil
+ end
+
def test_named_routes
with_routing do |set|
set.draw do