Sha256: dd982a579b93ecf9d2a2860e7ed4d96c4a3cd9ac44a303bcee3afeaccc299f8d

Contents?: true

Size: 1.08 KB

Versions: 12

Compression:

Stored size: 1.08 KB

Contents

require "webmock/rspec"

describe "get latest untagged pact badge" do

  before do
    PactBroker.configuration.enable_public_badge_access = true
    PactBroker.configuration.shields_io_base_url = nil
    TestDataBuilder.new
      .create_consumer("consumer")
      .create_provider("provider")
      .create_consumer_version("1.0.0")
      .create_pact
      .create_verification(success: true)
      .create_consumer_version("1.2.3")
      .create_consumer_version_tag("prod")
      .create_pact
      .create_verification(success: false)
  end

  let(:path) { "/pacts/provider/provider/consumer/consumer/latest-untagged/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 ">verified<"
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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