Sha256: 25305b25dc9b66238483fe0e28680c42080f121704e87eba3324458f4d10b311
Contents?: true
Size: 1.47 KB
Versions: 33
Compression:
Stored size: 1.47 KB
Contents
# frozen_string_literal: true require "spec_helper" module SecureHeaders describe XPermittedCrossDomainPolicies do specify { expect(XPermittedCrossDomainPolicies.make_header).to eq([XPermittedCrossDomainPolicies::HEADER_NAME, "none"]) } specify { expect(XPermittedCrossDomainPolicies.make_header("master-only")).to eq([XPermittedCrossDomainPolicies::HEADER_NAME, "master-only"]) } context "valid configuration values" do it "accepts 'all'" do expect do XPermittedCrossDomainPolicies.validate_config!("all") end.not_to raise_error end it "accepts 'by-ftp-filename'" do expect do XPermittedCrossDomainPolicies.validate_config!("by-ftp-filename") end.not_to raise_error end it "accepts 'by-content-type'" do expect do XPermittedCrossDomainPolicies.validate_config!("by-content-type") end.not_to raise_error end it "accepts 'master-only'" do expect do XPermittedCrossDomainPolicies.validate_config!("master-only") end.not_to raise_error end it "accepts nil" do expect do XPermittedCrossDomainPolicies.validate_config!(nil) end.not_to raise_error end end context "invlaid configuration values" do it "doesn't accept invalid values" do expect do XPermittedCrossDomainPolicies.validate_config!("open") end.to raise_error(XPCDPConfigError) end end end end
Version data entries
33 entries across 33 versions & 1 rubygems