Sha256: 93c11d535253376724895e18421b3f39ac8cf644da5efd1ad6b4f4dc05244054

Contents?: true

Size: 831 Bytes

Versions: 36

Compression:

Stored size: 831 Bytes

Contents

require 'spec_helper'

module SecureHeaders
  describe XDownloadOptions do
    specify { expect(XDownloadOptions.make_header).to eq([XDownloadOptions::HEADER_NAME, XDownloadOptions::DEFAULT_VALUE]) }
    specify { expect(XDownloadOptions.make_header('noopen')).to eq([XDownloadOptions::HEADER_NAME, 'noopen']) }

    context "invalid configuration values" do
      it "accepts noopen" do
        expect do
          XDownloadOptions.validate_config!("noopen")
        end.not_to raise_error
      end

      it "accepts nil" do
        expect do
          XDownloadOptions.validate_config!(nil)
        end.not_to raise_error
      end

      it "doesn't accept anything besides noopen" do
        expect do
          XDownloadOptions.validate_config!("open")
        end.to raise_error(XDOConfigError)
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
secure_headers-3.9.0 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.8.0 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.7.4 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.7.3 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.7.2 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.7.1 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.7.0 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.6.7 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.6.6 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.6.5 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.6.4 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.6.3 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.6.2 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.6.1 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.6.0 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.5.1 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.5.0 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.5.0.pre spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.4.1 spec/lib/secure_headers/headers/x_download_options_spec.rb
secure_headers-3.4.0 spec/lib/secure_headers/headers/x_download_options_spec.rb