Sha256: 2a378a3d6344444b31988cb44ac272ca90fcfb7fecc12a61bee1d7527cba137b

Contents?: true

Size: 803 Bytes

Versions: 12

Compression:

Stored size: 803 Bytes

Contents

require 'spec/support/test_data_builder'

describe "Get versions" do
  let(:path) { "/pacticipants/Consumer/versions" }
  let(:last_response_body) { JSON.parse(subject.body, symbolize_names: true) }

  subject { get(path) }

  context "when the pacticipant exists" do
    before do
      TestDataBuilder.new
        .create_consumer("Consumer")
        .create_consumer_version("1.0.0")
        .create_consumer_version("1.0.1")
    end

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

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

  context "when the pacticipant does not exist" do
    it "returns a 404 response" do
      expect(subject).to be_a_404_response
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.65.0 spec/features/get_versions_spec.rb
pact_broker-2.64.0 spec/features/get_versions_spec.rb
pact_broker-2.63.0 spec/features/get_versions_spec.rb
pact_broker-2.62.0 spec/features/get_versions_spec.rb
pact_broker-2.61.0 spec/features/get_versions_spec.rb
pact_broker-2.60.1 spec/features/get_versions_spec.rb
pact_broker-2.60.0 spec/features/get_versions_spec.rb
pact_broker-2.59.2 spec/features/get_versions_spec.rb
pact_broker-2.59.1 spec/features/get_versions_spec.rb
pact_broker-2.59.0 spec/features/get_versions_spec.rb
pact_broker-2.58.3 spec/features/get_versions_spec.rb
pact_broker-2.58.2 spec/features/get_versions_spec.rb