1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

⚠️ "Use assert_nil if expecting nil. This will fail in MT6."

This commit is contained in:
Akira Matsuda 2017-01-18 18:41:32 +09:00
parent 8c155c932f
commit c49cc4ae35

View file

@ -102,8 +102,12 @@ class StrictTransportSecurityTest < SSLTest
def assert_hsts(expected, url: "https://example.org", hsts: { subdomains: true }, headers: {})
self.app = build_app ssl_options: { hsts: hsts }, headers: headers
get url
if expected.nil?
assert_nil response.headers["Strict-Transport-Security"]
else
assert_equal expected, response.headers["Strict-Transport-Security"]
end
end
test "enabled by default" do
assert_hsts EXPECTED_WITH_SUBDOMAINS