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.52.1 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.52.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.51.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.50.1 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.50.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.49.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.48.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.47.1 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.47.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.46.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.45.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.44.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.43.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.42.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.41.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.40.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.39.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.38.1 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.38.0 spec/lib/pact_broker/build_http_options_spec.rb
pact_broker-2.37.0 spec/lib/pact_broker/build_http_options_spec.rb