Sha256: 0089119e583f3f3aa15c16db0e4a2c86377ff737ae755df980ddbc1c641c03de
Contents?: true
Size: 1.45 KB
Versions: 36
Compression:
Stored size: 1.45 KB
Contents
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
36 entries across 36 versions & 1 rubygems