Sha256: d1e6d297c241cfea7aedac7dfc24b5e705c8ffa16e90e31d56f1ca56c2433b3e

Contents?: true

Size: 1.13 KB

Versions: 60

Compression:

Stored size: 1.13 KB

Contents

require 'webmock/rspec'

describe "get latest matrix badge with tags" do

  before do
    PactBroker.configuration.enable_public_badge_access = true
    TestDataBuilder.new
      .create_consumer('consumer')
      .create_provider('provider')
      .create_consumer_version('1')
      .create_consumer_version_tag('prod')
      .create_pact
      .create_verification(provider_version: '4')
      .use_provider_version('4')
      .create_provider_version_tag('master')
  end

  let!(:http_request) do
    stub_request(:get, /http/).to_return(:status => 200, :body => "<svg/>")
  end

  let(:path) { "/matrix/provider/provider/latest/master/consumer/consumer/latest/prod/badge" }

  # In the full app, the .svg extension is turned into an Accept header
  # by ConvertFileExtensionToAcceptHeader

  subject { get path, nil, {'HTTP_ACCEPT' => "image/svg+xml"}; last_response  }

  it "returns a 200 status" do
    expect(subject.status).to eq 200
  end

  it "returns an svg/xml response" do
    expect(subject.headers['Content-Type']).to include("image/svg+xml")
  end

  it "returns an svg body" do
    expect(subject.body).to include "<svg/>"
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
pact_broker-2.52.2 spec/features/get_matrix_badge_spec.rb
pact_broker-2.52.1 spec/features/get_matrix_badge_spec.rb
pact_broker-2.52.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.51.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.50.1 spec/features/get_matrix_badge_spec.rb
pact_broker-2.50.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.49.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.48.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.47.1 spec/features/get_matrix_badge_spec.rb
pact_broker-2.47.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.46.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.45.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.44.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.43.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.42.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.41.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.40.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.39.0 spec/features/get_matrix_badge_spec.rb
pact_broker-2.38.1 spec/features/get_matrix_badge_spec.rb
pact_broker-2.38.0 spec/features/get_matrix_badge_spec.rb