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.65.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.64.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.63.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.62.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.61.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.60.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.60.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.59.2 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.59.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.59.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.58.3 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.58.2 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.58.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.57.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.56.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.56.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.55.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.54.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.53.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.52.2 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb