Sha256: 6e26c3c672a9209416d306699583ab8dc492fbf19c4d2aa963930b12d2f5d988
Contents?: true
Size: 1.23 KB
Versions: 27
Compression:
Stored size: 1.23 KB
Contents
require 'spec_helper' module SecureHeaders describe StrictTransportSecurity do describe "#value" do specify { expect(StrictTransportSecurity.make_header).to eq([StrictTransportSecurity::HEADER_NAME, StrictTransportSecurity::DEFAULT_VALUE]) } specify { expect(StrictTransportSecurity.make_header("max-age=1234; includeSubdomains; preload")).to eq([StrictTransportSecurity::HEADER_NAME, "max-age=1234; includeSubdomains; preload"]) } context "with an invalid configuration" do context "with a string argument" do it "raises an exception with an invalid max-age" do expect do StrictTransportSecurity.validate_config!('max-age=abc123') end.to raise_error(STSConfigError) end it "raises an exception if max-age is not supplied" do expect do StrictTransportSecurity.validate_config!('includeSubdomains') end.to raise_error(STSConfigError) end it "raises an exception with an invalid format" do expect do StrictTransportSecurity.validate_config!('max-age=123includeSubdomains') end.to raise_error(STSConfigError) end end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems