Sha256: 0bed8e406cfe529eff48970ed1efab4a5db80e5300b4bedd4c2f4b8424af66e2

Contents?: true

Size: 1.03 KB

Versions: 56

Compression:

Stored size: 1.03 KB

Contents

require 'spec/support/test_data_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
      TestDataBuilder.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
      TestDataBuilder.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

56 entries across 56 versions & 1 rubygems

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