Sha256: 51d161475a858567f7c0af1ce6b6c5ac62c38e3c8dfcf5fdfb034f479ec4a405

Contents?: true

Size: 832 Bytes

Versions: 21

Compression:

Stored size: 832 Bytes

Contents

require 'spec/support/provider_state_builder'

describe "Get versions" do

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

  subject { get path; last_response }

  context "when the pacticipant exists" do

    before do
      ProviderStateBuilder.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

21 entries across 21 versions & 1 rubygems

Version Path
pact_broker-2.0.5 spec/features/get_versions_spec.rb
pact_broker-2.0.4 spec/features/get_versions_spec.rb
pact_broker-2.0.3 spec/features/get_versions_spec.rb
pact_broker-2.0.2 spec/features/get_versions_spec.rb
pact_broker-2.0.1 spec/features/get_versions_spec.rb
pact_broker-2.0.0 spec/features/get_versions_spec.rb
pact_broker-2.0.0.beta.8 spec/features/get_versions_spec.rb
pact_broker-2.0.0.beta.7 spec/features/get_versions_spec.rb
pact_broker-2.0.0.beta.6 spec/features/get_versions_spec.rb
pact_broker-1.18.0 spec/features/get_versions_spec.rb
pact_broker-2.0.0.beta.5 spec/features/get_versions_spec.rb
pact_broker-1.18.0.beta.1 spec/features/get_versions_spec.rb
pact_broker-1.17.2 spec/features/get_versions_spec.rb
pact_broker-1.17.1 spec/features/get_versions_spec.rb
pact_broker-2.0.0.beta.4 spec/features/get_versions_spec.rb
pact_broker-2.0.0.beta.3 spec/features/get_versions_spec.rb
pact_broker-2.0.0.beta.2 spec/features/get_versions_spec.rb
pact_broker-2.0.0.beta.1 spec/features/get_versions_spec.rb
pact_broker-1.17.0 spec/features/get_versions_spec.rb
pact_broker-1.16.0 spec/features/get_versions_spec.rb