Sha256: 5f823d7ac52cb66e179c20e1004b39af861705ad769742b791d40df9a0ce2fe0

Contents?: true

Size: 1.22 KB

Versions: 96

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'
require 'pact_broker/build_http_options'

module PactBroker
  describe BuildHttpOptions do

    subject { PactBroker::BuildHttpOptions.call(url) }

    context "default http options" do
      before do
        PactBroker.configuration.disable_ssl_verification = false
      end

      describe "when given an insecure URL" do
        let(:url) { 'http://example.org/insecure' }
        
        it "should provide an empty configuration object" do
          expect(subject).to eq({})
        end
        
      end
      
      describe "when given a secure URL" do
        let(:url) { 'https://example.org/secure' }
        
        it "should validate the full certificate chain" do
          expect(subject).to include({:use_ssl => true, :verify_mode => 1})
        end
        
      end
    end
    
    context "disable_ssl_verification is set to true" do
      before do
        PactBroker.configuration.disable_ssl_verification = true
      end
      
      let(:url) { 'https://example.org/secure' }
      
      describe "when given a secure URL" do
        it "should not validate certificates" do
          expect(subject).to include({:use_ssl => true, :verify_mode => 0})
        end
      end
    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
pact_broker-2.79.1 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.79.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.78.1 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.78.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.77.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.76.2 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.76.1 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.76.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.75.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.74.1 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.74.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.73.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.72.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.71.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.70.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.69.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.68.1 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.68.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.67.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.66.0 spec/lib/pact_broker/build_http_options_spec.rb