Sha256: f8b4524c462668b623124739d91d48edd3edc7ed6b88504d53636a7a5ee973c6

Contents?: true

Size: 1.25 KB

Versions: 12

Compression:

Stored size: 1.25 KB

Contents

RSpec.describe "Get currently deployed versions for version" do
  let!(:version) { td.create_consumer("Foo").create_consumer_version("1").and_return(:consumer_version) }
  let!(:test_environment) { td.create_environment("test").and_return(:environment) }
  let!(:prod_environment) { td.create_environment("prod").and_return(:environment) }
  let!(:deployed_version) do
    td.create_deployed_version_for_consumer_version(environment_name: "test", created_at: DateTime.now - 2)
      .create_deployed_version_for_consumer_version(environment_name: "prod", created_at: DateTime.now - 1)
  end

  let(:path) do
    PactBroker::Api::PactBrokerUrls.deployed_versions_for_version_and_environment_url(
      version,
      test_environment
    )
  end

  let(:response_body_hash) { JSON.parse(subject.body, symbolize_names: true) }

  subject { get(path, nil, { "HTTP_ACCEPT" => "application/hal+json" }) }

  it "returns a list of deployed versions" do
    expect(response_body_hash[:_embedded][:deployedVersions]).to be_a(Array)
    expect(response_body_hash[:_embedded][:deployedVersions].size).to eq 1
    expect(response_body_hash[:_links][:self][:title]).to eq "Deployed versions for Foo version 1"
    expect(response_body_hash[:_links][:self][:href]).to end_with(path)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.89.0 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.88.0 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.87.0 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.86.0 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.85.1 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.85.0 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.84.0 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.83.0 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.82.0 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.81.0 spec/features/get_currently_deployed_versions_for_version_spec.rb
pact_broker-2.80.0 spec/features/get_currently_deployed_versions_for_version_spec.rb