Sha256: 4ee2b4b31af9c5f6a14295af6542fddd294c31025971006af045dad037b828aa

Contents?: true

Size: 1.02 KB

Versions: 20

Compression:

Stored size: 1.02 KB

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

    context "with pagination options" do
      subject { get(path, { 'pageSize' => '1', 'pageNumber' => '1' }) }

      it "paginates the response" do
        expect(last_response_body[:_links][:"versions"].size).to eq 1
      end
    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

20 entries across 20 versions & 1 rubygems

Version Path
pact_broker-2.79.1 spec/features/get_versions_spec.rb
pact_broker-2.79.0 spec/features/get_versions_spec.rb
pact_broker-2.78.1 spec/features/get_versions_spec.rb
pact_broker-2.78.0 spec/features/get_versions_spec.rb
pact_broker-2.77.0 spec/features/get_versions_spec.rb
pact_broker-2.76.2 spec/features/get_versions_spec.rb
pact_broker-2.76.1 spec/features/get_versions_spec.rb
pact_broker-2.76.0 spec/features/get_versions_spec.rb
pact_broker-2.75.0 spec/features/get_versions_spec.rb
pact_broker-2.74.1 spec/features/get_versions_spec.rb
pact_broker-2.74.0 spec/features/get_versions_spec.rb
pact_broker-2.73.0 spec/features/get_versions_spec.rb
pact_broker-2.72.0 spec/features/get_versions_spec.rb
pact_broker-2.71.0 spec/features/get_versions_spec.rb
pact_broker-2.70.0 spec/features/get_versions_spec.rb
pact_broker-2.69.0 spec/features/get_versions_spec.rb
pact_broker-2.68.1 spec/features/get_versions_spec.rb
pact_broker-2.68.0 spec/features/get_versions_spec.rb
pact_broker-2.67.0 spec/features/get_versions_spec.rb
pact_broker-2.66.0 spec/features/get_versions_spec.rb