Sha256: 768ccf013d174ae0836f5c7e58631695c611e33fcfae9adae3265d8ac626e07f

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

require "pact_broker/ui/app"

describe "UI matrix" do
  let(:app) { PactBroker::UI::App.new }
  let(:td) { TestDataBuilder.new }
  let(:params) { {} }

  before do
    td.create_pact_with_verification("Foo", "1", "Bar", "2")
      .create_consumer_version_tag("ctag")
      .create_provider_version_tag("ptag")
  end

  subject { get("/matrix/provider/Bar/consumer/Foo") }

  describe "GET" do
    it "returns a success response" do
      expect(subject.status).to eq 200
    end

    it "returns the matrix page" do
      expect(subject.body).to include("Matrix")
    end

    it "returns a table of matrix rows" do
      expect(subject.body.scan("<tr").to_a.size).to be > 1
    end
  end

  describe "with query params, for the latest tagged versions of two pacticipants" do
    subject { get("/matrix?q%5B%5Dpacticipant=Foo&q%5B%5Dtag=ctag&q%5B%5Dlatest=true&q%5B%5Dpacticipant=Bar&q%5B%5Dtag=ptag&q%5B%5Dlatest=true&latestby=cvpv&limit=100") }

    it "returns a page with a badge" do
      expect(subject.body).to include "/matrix/provider/Bar/latest/ptag/consumer/Foo/latest/ctag/badge.svg"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pact_broker-2.83.0 spec/integration/ui/matrix_spec.rb
pact_broker-2.82.0 spec/integration/ui/matrix_spec.rb
pact_broker-2.81.0 spec/integration/ui/matrix_spec.rb
pact_broker-2.80.0 spec/integration/ui/matrix_spec.rb