From 8cddbf0d37c557688bf833e5437a88d98cfaf046 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 27 Feb 2005 17:11:05 +0000 Subject: Added PATH_INFO access from the request that allows urls like the following to be interpreted by rails: http://www.example.com/dispatcher.cgi/controller/action -- that makes it possible to use rails as a CGI under lighttpd and would also allow (for example) Rublog to be ported to rails without breaking existing links to Rublog-powered blogs. #728 [Jamis Buck] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@802 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/request_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index c31cdd460b..82a1d6bb70 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -54,6 +54,12 @@ class RequestTest < Test::Unit::TestCase assert_equal "/", @request.path end + def test_path_info + @request.env["PATH_INFO"] = "/path/of/some/uri" + assert_equal "/path/of/some/uri", @request.path_info + assert_equal "/path/of/some/uri", @request.path + end + def test_host_with_port @request.env['HTTP_HOST'] = "rubyonrails.org:8080" assert_equal "rubyonrails.org:8080", @request.host_with_port @@ -67,4 +73,4 @@ class RequestTest < Test::Unit::TestCase @request.port = 81 assert_equal "rubyonrails.org:81", @request.host_with_port end -end \ No newline at end of file +end -- cgit v1.2.3