Sha256: 360e8376e37e2ecf12d58b623842ecad1f8c878fb4c05638b2ea96fab3244b97

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

require "pact_broker/ui/app"

describe "UI matrix" do
  let(:app) { PactBroker::UI::App.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

8 entries across 8 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/integration/ui/matrix_spec.rb
pact_broker-2.89.0 spec/integration/ui/matrix_spec.rb
pact_broker-2.88.0 spec/integration/ui/matrix_spec.rb
pact_broker-2.87.0 spec/integration/ui/matrix_spec.rb
pact_broker-2.86.0 spec/integration/ui/matrix_spec.rb
pact_broker-2.85.1 spec/integration/ui/matrix_spec.rb
pact_broker-2.85.0 spec/integration/ui/matrix_spec.rb
pact_broker-2.84.0 spec/integration/ui/matrix_spec.rb