Sha256: d99e75f4c62acd34ac4cabfde6ad4df5871e253f895aa5969c13ba0e156fde24

Contents?: true

Size: 1.04 KB

Versions: 39

Compression:

Stored size: 1.04 KB

Contents

require 'spec/support/provider_state_builder'

describe "Get version" do

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

  subject { get path; last_response }

  context "when the version exists" do

    before do
      ProviderStateBuilder.new
        .create_consumer("Another Consumer")
        .create_consumer("Consumer")
        .create_consumer_version("1.2.3")
        .create_consumer_version_tag("prod")
        .create_consumer_version("1.2.4")
    end


    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 version" do
      expect(last_response_body).to include number: '1.2.3'
    end

  end

  context "when the version does not exist" do

    before do
      ProviderStateBuilder.new
        .create_consumer("Consumer")
        .create_version("1.2.4")
    end

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

  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

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