Sha256: c145ae5893d522da24f6682212d50688e42fb6038a707e4a810feb2cc80a73f4

Contents?: true

Size: 1.1 KB

Versions: 18

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'
require 'pact_broker/domain/webhook'

module PactBroker

  module Domain

    describe Webhook do

      let(:consumer) { Pacticipant.new(name: 'Consumer')}
      let(:provider) { Pacticipant.new(name: 'Provider')}
      let(:request) { instance_double(PactBroker::Domain::WebhookRequest, execute: nil)}
      let(:options) { double('options') }
      let(:pact) { double('pact') }

      subject { Webhook.new(request: request, consumer: consumer, provider: provider,) }

      describe "description" do
        it "returns a description of the webhook" do
          expect(subject.description).to eq "A webhook for the pact between Consumer and Provider"
        end
      end

      describe "execute" do

        it "executes the request" do
          expect(request).to receive(:execute).with(pact, options)
          subject.execute pact, options
        end

        it "logs before and after" do
          allow(PactBroker.logger).to receive(:info)
          expect(PactBroker.logger).to receive(:info).with(/Executing/)
          subject.execute pact, options
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pact_broker-2.20.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.19.2 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.19.1 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.19.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.18.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.17.1 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.17.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.16.1 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.16.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.15.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.14.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.13.1 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.13.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.12.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.11.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.10.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.9.0 spec/lib/pact_broker/domain/webhook_spec.rb
pact_broker-2.9.0.beta.5 spec/lib/pact_broker/domain/webhook_spec.rb