Skip to content

Commit ede35f9

Browse files
committed
Merge pull request #244 from stve/tests
Additional tests
2 parents e1321c5 + 74279a8 commit ede35f9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spec/lib/secure_headers_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ module SecureHeaders
2020
end.to raise_error(Configuration::NotYetConfiguredError)
2121
end
2222

23+
it "raises and ArgumentError when referencing an override that has not been set" do
24+
expect do
25+
Configuration.default
26+
SecureHeaders.use_secure_headers_override(request, :missing)
27+
end.to raise_error(ArgumentError)
28+
end
29+
2330
describe "#header_hash_for" do
2431
it "allows you to opt out of individual headers via API" do
2532
Configuration.default
@@ -312,6 +319,14 @@ module SecureHeaders
312319
end
313320
end.to raise_error(PublicKeyPinsConfigError)
314321
end
322+
323+
it "validates your cookies config upon configuration" do
324+
expect do
325+
Configuration.default do |config|
326+
config.cookies = { secure: "lol" }
327+
end
328+
end.to raise_error(CookiesConfigError)
329+
end
315330
end
316331
end
317332
end

0 commit comments

Comments
 (0)