aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/request_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb
index a7623f3403..43cd8836fe 100644
--- a/actionpack/test/controller/request_test.rb
+++ b/actionpack/test/controller/request_test.rb
@@ -105,6 +105,19 @@ class RequestTest < Test::Unit::TestCase
@request.relative_url_root = nil
@request.env['SCRIPT_NAME'] = "/collaboration/hieraki"
assert_equal "/collaboration/hieraki", @request.relative_url_root
+
+ @request.relative_url_root = nil
+ @request.env['SCRIPT_NAME'] = "/hieraki/dispatch.cgi"
+ @request.env['SERVER_SOFTWARE'] = 'lighttpd/1.2.3'
+ @request.env['RAILS_RELATIVE_URL_ROOT'] = "/hieraki"
+ assert_equal "/hieraki", @request.relative_url_root
+
+ # @env overrides path guess
+ @request.relative_url_root = nil
+ @request.env['SCRIPT_NAME'] = "/hieraki/dispatch.cgi"
+ @request.env['SERVER_SOFTWARE'] = 'apache/1.2.3 some random text'
+ @request.env['RAILS_RELATIVE_URL_ROOT'] = "/real_url"
+ assert_equal "/real_url", @request.relative_url_root
end
def test_request_uri