aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2011-08-23 15:33:59 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2011-08-23 15:33:59 +0100
commitebea387e4bb9f44d8c678ed9bad2ab2091d1f9c6 (patch)
tree40d466d61f2d068883f0353746385627f6eefb2e /actionpack
parent13400ac289344dae002c77a3c2b820268f08745e (diff)
downloadrails-ebea387e4bb9f44d8c678ed9bad2ab2091d1f9c6.tar.gz
rails-ebea387e4bb9f44d8c678ed9bad2ab2091d1f9c6.tar.bz2
rails-ebea387e4bb9f44d8c678ed9bad2ab2091d1f9c6.zip
Add failing test case for #2654
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/controller/test_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb
index eae5a3d472..cba3aded2f 100644
--- a/actionpack/test/controller/test_test.rb
+++ b/actionpack/test/controller/test_test.rb
@@ -50,6 +50,10 @@ class TestTest < ActionController::TestCase
render :text => request.query_string
end
+ def test_protocol
+ render :text => request.protocol
+ end
+
def test_html_output
render :text => <<HTML
<html>
@@ -598,6 +602,19 @@ XML
assert_nil @request.symbolized_path_parameters[:id]
end
+ def test_request_protocol_is_reset_after_request
+ get :test_protocol
+ assert_equal "http://", @response.body
+
+ @request.env["HTTPS"] = "on"
+ get :test_protocol
+ assert_equal "https://", @response.body
+
+ @request.env.delete("HTTPS")
+ get :test_protocol
+ assert_equal "http://", @response.body
+ end
+
def test_should_have_knowledge_of_client_side_cookie_state_even_if_they_are_not_set
cookies['foo'] = 'bar'
get :no_op