Sha256: c3ecde87e42fa35c8f70b2382b179131394d599de5e8bb1b58de756b7beb9098

Contents?: true

Size: 819 Bytes

Versions: 9

Compression:

Stored size: 819 Bytes

Contents

require 'pact_broker/domain/relationship'

module PactBroker
  module Domain
    describe Relationship 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 { Relationship.create(nil, nil, nil, 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

9 entries across 9 versions & 1 rubygems

Version Path
pact_broker-2.9.0 spec/lib/pact_broker/domain/relationship_spec.rb
pact_broker-2.9.0.beta.5 spec/lib/pact_broker/domain/relationship_spec.rb
pact_broker-2.8.0.beta.5 spec/lib/pact_broker/domain/relationship_spec.rb
pact_broker-2.8.0.beta.4 spec/lib/pact_broker/domain/relationship_spec.rb
pact_broker-2.7.0.beta.3 spec/lib/pact_broker/domain/relationship_spec.rb
pact_broker-2.7.0.beta.2 spec/lib/pact_broker/domain/relationship_spec.rb
pact_broker-2.6.0 spec/lib/pact_broker/domain/relationship_spec.rb
pact_broker-2.5.1 spec/lib/pact_broker/domain/relationship_spec.rb
pact_broker-2.5.0 spec/lib/pact_broker/domain/relationship_spec.rb