Permalink
Browse files

Add failing test case for #2654

  • Loading branch information...
1 parent 4327e21 commit 257061d730fb6ff0e72b1252e68b41441a7e54a5 @pixeltrix pixeltrix committed with spastorino Aug 23, 2011
Showing with 17 additions and 0 deletions.
  1. +17 −0 actionpack/test/controller/test_test.rb
View
17 actionpack/test/controller/test_test.rb
@@ -50,6 +50,10 @@ def test_query_string
render :text => request.query_string
end
+ def test_protocol
+ render :text => request.protocol
+ end
+
def test_html_output
render :text => <<HTML
<html>
@@ -592,6 +596,19 @@ def test_symbolized_path_params_reset_after_request
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
@request.cookies['foo'] = 'bar'
get :no_op

0 comments on commit 257061d

Please sign in to comment.