Sha256: 373d18440c7cfc8087f61b0f4f1278d8f01e921a4f5e84bbc4cef180a065abc6

Contents?: true

Size: 1.04 KB

Versions: 108

Compression:

Stored size: 1.04 KB

Contents

require 'spec/support/test_data_builder'

describe "Get matrix for consumer and provider" do
  before do
    TestDataBuilder.new
      .create_pact_with_hierarchy('Consumer', '1.0.0', 'Provider')
      .create_verification(provider_version: '4.5.6')
  end

  let(:path) { "/matrix" }
  let(:params) do
    {
      q: [
        { pacticipant: 'Consumer', version: '1.0.0' },
        { pacticipant: 'Provider', version: '4.5.6' }
      ]
    }
  end
  let(:last_response_body) { JSON.parse(subject.body, symbolize_names: true) }

  subject { get path, params; last_response }

  it "returns a 200 HAL JSON response" do
    expect(subject).to be_a_hal_json_success_response
  end

  it "returns the JSON representation of the matrix" do
    expect(last_response_body[:matrix][0][:consumer]).to be_instance_of(Hash)
    expect(last_response_body[:matrix][0][:provider]).to be_instance_of(Hash)
    expect(last_response_body[:matrix][0][:pact]).to be_instance_of(Hash)
    expect(last_response_body[:matrix][0][:verificationResult]).to be_instance_of(Hash)
  end
end

Version data entries

108 entries across 108 versions & 1 rubygems

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