Sha256: f1d10e36e1348f7a5b3649bd56429ffc248c0044322fd9b1901f4911c43da5cc

Contents?: true

Size: 822 Bytes

Versions: 8

Compression:

Stored size: 822 Bytes

Contents

require "pact_broker/domain/index_item"

module PactBroker
  module Domain
    describe IndexItem do
      describe "#last_webhook_execution_date" do
        let(:webhook_execution_1) { double("webhook_execution", created_at: DateTime.new(2013)) }
        let(:webhook_execution_2) { double("webhook_execution", created_at: DateTime.new(2015)) }

        let(:webhook_executions) { [webhook_execution_1, webhook_execution_2] }

        before do
          allow(webhook_executions).to receive(:sort).and_return(webhook_executions)
        end

        subject { IndexItem.create(nil, nil, nil, nil, true, nil, [], webhook_executions) }

        it "returns the created_at date of the last execution" do
          expect(subject.last_webhook_execution_date).to eq DateTime.new(2015)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/lib/pact_broker/domain/index_item_spec.rb
pact_broker-2.89.0 spec/lib/pact_broker/domain/index_item_spec.rb
pact_broker-2.88.0 spec/lib/pact_broker/domain/index_item_spec.rb
pact_broker-2.87.0 spec/lib/pact_broker/domain/index_item_spec.rb
pact_broker-2.86.0 spec/lib/pact_broker/domain/index_item_spec.rb
pact_broker-2.85.1 spec/lib/pact_broker/domain/index_item_spec.rb
pact_broker-2.85.0 spec/lib/pact_broker/domain/index_item_spec.rb
pact_broker-2.84.0 spec/lib/pact_broker/domain/index_item_spec.rb