Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Split out the test.

  • Loading branch information...
commit b7f1cead3ebc7529ec7a1c8451587071623a6ae3 1 parent 81fccaa
Eric Lindvall eric authored
Showing with 15 additions and 2 deletions.
  1. +15 −2 test/test_ssl.rb
17 test/test_ssl.rb
View
@@ -9,7 +9,7 @@ class TestSSL < Test::Unit::TestCase
def default_app
lambda { |env|
headers = {'Content-Type' => "text/html"}
- headers['Set-Cookie'] = "id=1; path=/\ntoken=abc; path=/; secure; HttpOnly\ntoken=3; path=/; secure"
+ headers['Set-Cookie'] = "id=1; path=/\ntoken=abc; path=/; secure; HttpOnly"
[200, headers, ["OK"]]
}
end
@@ -77,7 +77,20 @@ def test_hsts_include_subdomains
def test_flag_cookies_as_secure
get "https://example.org/"
- assert_equal ["id=1; path=/; secure", "token=abc; path=/; secure; HttpOnly", "token=3; path=/; secure" ],
+ assert_equal ["id=1; path=/; secure", "token=abc; path=/; secure; HttpOnly" ],
+ last_response.headers['Set-Cookie'].split("\n")
+ end
+
+ def test_flag_cookies_as_secure_at_end_of_line
+ default_app = lambda { |env|
+ headers = {'Content-Type' => "text/html",
+ 'Set-Cookie' => "problem=def; path=/; HttpOnly; secure" }
+ [200, headers, ["OK"]]
+ }
+ self.app = Rack::SSL.new(default_app)
+
+ get "https://example.org/"
+ assert_equal ["problem=def; path=/; HttpOnly; secure" ],
last_response.headers['Set-Cookie'].split("\n")
end
Please sign in to comment.
Something went wrong with that request. Please try again.