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.79.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.79.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.78.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.78.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.77.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.76.2 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.76.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.76.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.75.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.74.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.74.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.73.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.72.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.71.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.70.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.69.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.68.1 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.68.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.67.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb
pact_broker-2.66.0 spec/features/base_equality_only_on_content_that_affects_verification_results_spec.rb