Sha256: 54034fdbef02ff385ccfc420bdbe96ceb26086fe71390c59855d2ffda3a1e72f

Contents?: true

Size: 1.77 KB

Versions: 59

Compression:

Stored size: 1.77 KB

Contents

require 'pact_broker/verifications/verification_status'

module PactBroker
  module Verifications
    describe Status do
      describe "verification_status" do

        let(:latest_verification) { instance_double("PactBroker::Domain::Verification", pact_version_sha: latest_verification_pact_version_sha, success: success) }
        let(:latest_pact) { instance_double("PactBroker::Domain::Pact", pact_version_sha: pact_pact_version_sha) }
        let(:pact_pact_version_sha) { '1234' }
        let(:latest_verification_pact_version_sha) { '1234' }
        let(:success) { true }

        subject { PactBroker::Verifications::Status.new(latest_pact, latest_verification) }

        context "when the pact is nil (used in badge resource)" do
          let(:latest_pact) { nil }
          its(:to_sym) { is_expected.to eq :never }
        end

        context "when the pact has never been verified" do
          let(:latest_verification) { nil }
          its(:to_sym) { is_expected.to eq :never }
        end

        context "when the pact has not changed since the last successful verification" do
          its(:to_sym) { is_expected.to eq :success }
        end

        context "when the pact has not changed since the last failed verification" do
          let(:success) { false }
          its(:to_sym) { is_expected.to eq :failed }
        end

        context "when the pact has changed since the last successful verification" do
          let(:pact_pact_version_sha) { '4566' }
          its(:to_sym) { is_expected.to eq :stale }
        end

        context "when the pact has changed since the last failed verification" do
          let(:pact_pact_version_sha) { '4566' }
          let(:success) { false }
          its(:to_sym) { is_expected.to eq :failed }
        end
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
pact_broker-2.38.1 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.38.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.37.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.36.1 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.36.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.35.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.34.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.33.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.32.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.31.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.30.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.29.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.27.6 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.27.5 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.27.4 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.27.3 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.27.2 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.27.0 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.26.1 spec/lib/pact_broker/verifications/verification_status_spec.rb
pact_broker-2.26.0 spec/lib/pact_broker/verifications/verification_status_spec.rb