Sha256: 070f6d4109f1caa1fd6b70145315c38c39a90f58901565f0d7e586cb15d21180

Contents?: true

Size: 1.61 KB

Versions: 88

Compression:

Stored size: 1.61 KB

Contents

RSpec.describe "base_equality_only_on_content_that_affects_verification_results" do
  let(:td) { TestDataBuilder.new }
  let(:json_content_1) { load_fixture('foo-bar.json') }
  let(:json_content_2) do
    pact_hash = load_json_fixture('foo-bar.json')
    pact_hash['interactions'] = pact_hash['interactions'].reverse
    pact_hash.to_json
  end
  let(:base_equality_only_on_content_that_affects_verification_results) { true }

  before do
    PactBroker.configuration.base_equality_only_on_content_that_affects_verification_results = base_equality_only_on_content_that_affects_verification_results
    td.create_pact_with_hierarchy("Foo", "1", "Bar", json_content_1)
      .create_verification(provider_version: "5")
      .create_consumer_version("2")
      .create_pact(json_content: json_content_2)
  end

  context "when a pact is published with a different order of interactions to a previous version, but which is otherwise the same" do
    context "when base_equality_only_on_content_that_affects_verification_results is true" do
      it "applies the verifications from the previous version" do
        expect(PactBroker::Matrix::Row.all).to contain_hash(consumer_version_number: "2", provider_version_number: "5")
      end
    end

    context "when base_equality_only_on_content_that_affects_verification_results is false" do
      let(:base_equality_only_on_content_that_affects_verification_results) { false }

      it "does not apply the verifications from the previous version" do
        expect(PactBroker::Matrix::Row.all).to_not contain_hash(consumer_version_number: "2", provider_version_number: "5")
      end
    end
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
pact_broker-2.36.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.36.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.35.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.34.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.33.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.32.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.31.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.30.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.29.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.27.6 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.27.5 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.27.4 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.27.3 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.27.2 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.27.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.26.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.26.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.25.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.24.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.23.4 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb