diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-12 07:01:39 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-12 07:01:39 +0000 |
commit | fe736a54f914b7cf406988f42df6c5c129d821a5 (patch) | |
tree | 2ff6867d89630f13f674f0f76498a978e6a99ecf /actionpack/test | |
parent | 89b472aa0cba44aa908348769abcde74025f6ec4 (diff) | |
download | rails-fe736a54f914b7cf406988f42df6c5c129d821a5.tar.gz rails-fe736a54f914b7cf406988f42df6c5c129d821a5.tar.bz2 rails-fe736a54f914b7cf406988f42df6c5c129d821a5.zip |
Set request.env['REQUEST_URI'] when absent.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5895 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/request_test.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index db81eb3097..f27e71262e 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -174,48 +174,54 @@ class RequestTest < Test::Unit::TestCase assert_equal "/path/of/some/uri?mapped=1", @request.request_uri assert_equal "/path/of/some/uri", @request.path + @request.set_REQUEST_URI nil @request.relative_url_root = nil @request.env['PATH_INFO'] = "/path/of/some/uri?mapped=1" @request.env['SCRIPT_NAME'] = "/path/dispatch.rb" assert_equal "/path/of/some/uri?mapped=1", @request.request_uri assert_equal "/of/some/uri", @request.path + @request.set_REQUEST_URI nil @request.relative_url_root = nil @request.env['PATH_INFO'] = "/path/of/some/uri" @request.env['SCRIPT_NAME'] = nil assert_equal "/path/of/some/uri", @request.request_uri assert_equal "/path/of/some/uri", @request.path + @request.set_REQUEST_URI nil @request.relative_url_root = nil @request.env['PATH_INFO'] = "/" assert_equal "/", @request.request_uri assert_equal "/", @request.path + @request.set_REQUEST_URI nil @request.relative_url_root = nil @request.env['PATH_INFO'] = "/?m=b" assert_equal "/?m=b", @request.request_uri assert_equal "/", @request.path - + + @request.set_REQUEST_URI nil @request.relative_url_root = nil @request.env['PATH_INFO'] = "/" @request.env['SCRIPT_NAME'] = "/dispatch.cgi" assert_equal "/", @request.request_uri - assert_equal "/", @request.path + assert_equal "/", @request.path + @request.set_REQUEST_URI nil @request.relative_url_root = nil @request.env['PATH_INFO'] = "/hieraki/" @request.env['SCRIPT_NAME'] = "/hieraki/dispatch.cgi" assert_equal "/hieraki/", @request.request_uri - assert_equal "/", @request.path - + assert_equal "/", @request.path + @request.set_REQUEST_URI '/hieraki/dispatch.cgi' @request.relative_url_root = '/hieraki' - assert_equal "/dispatch.cgi", @request.path + assert_equal "/dispatch.cgi", @request.path @request.relative_url_root = nil @request.set_REQUEST_URI '/hieraki/dispatch.cgi' @request.relative_url_root = '/foo' - assert_equal "/hieraki/dispatch.cgi", @request.path + assert_equal "/hieraki/dispatch.cgi", @request.path @request.relative_url_root = nil # This test ensures that Rails uses REQUEST_URI over PATH_INFO @@ -226,7 +232,7 @@ class RequestTest < Test::Unit::TestCase assert_equal "/some/path", @request.request_uri assert_equal "/some/path", @request.path end - + def test_host_with_port @request.host = "rubyonrails.org" |