Sha256: 18197376b5d9e9b5d12a0d829c0d7a6e0e5fe905a8dda1feafa008730d7f7d3b

Contents?: true

Size: 913 Bytes

Versions: 57

Compression:

Stored size: 913 Bytes

Contents

require 'spec/support/test_data_builder'

describe "Get pact versions" do

  let(:path) { "/pacts/provider/Provider/consumer/Consumer/versions" }
  let(:last_response_body) { JSON.parse(subject.body, symbolize_names: true) }

  subject { get path; last_response }

  context "when the pacts exist" do

    before do
      TestDataBuilder.new
        .create_provider("Provider")
        .create_consumer("Consumer")
        .create_consumer_version("1.0.0")
        .create_pact
        .create_consumer_version("1.0.1")
        .create_pact
    end

    it "returns a 200 response" do
      expect(subject.status).to be 200
    end

    it "returns a list of links to the pacts" do
      expect(last_response_body[:_links][:"pact-versions"].size).to eq 2
    end

  end

  context "when the pacts do not exist" do

    it "returns a 404 response" do
      expect(subject).to be_a_404_response
    end

  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

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