Sha256: d17b39b8abb7b84f65dcc420cf2362ce2a0e2705435bb476541977effce813db

Contents?: true

Size: 828 Bytes

Versions: 29

Compression:

Stored size: 828 Bytes

Contents

require 'pact_broker/ui/app'

describe "UI index" do

  let(:app) { PactBroker::UI::App.new }
  let(:td) { TestDataBuilder.new }
  let(:params) { {} }

  before do
    td.create_pact_with_hierarchy("Foo", "1", "Bar")
      .create_consumer_version_tag("prod")
      .create_consumer_version("2")
      .create_pact
    get "/"
  end

  subject { get("/", params, {}); last_response }

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

    it "returns a table of pacts" do
      expect(subject.body.scan('<tr').to_a.count).to eq 1
    end

    context "with an array of tags" do
      let(:params) { { tags: ['prod'] } }

      it "returns a table of pacts with the specfied tags" do
        expect(subject.body.scan('<tr').to_a.count).to eq 2
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
pact_broker-2.27.2 spec/integration/ui/index_spec.rb
pact_broker-2.27.0 spec/integration/ui/index_spec.rb
pact_broker-2.26.1 spec/integration/ui/index_spec.rb
pact_broker-2.26.0 spec/integration/ui/index_spec.rb
pact_broker-2.25.0 spec/integration/ui/index_spec.rb
pact_broker-2.24.0 spec/integration/ui/index_spec.rb
pact_broker-2.23.4 spec/integration/ui/index_spec.rb
pact_broker-2.23.3 spec/integration/ui/index_spec.rb
pact_broker-2.23.2 spec/integration/ui/index_spec.rb
pact_broker-2.23.1 spec/integration/ui/index_spec.rb
pact_broker-2.23.0 spec/integration/ui/index_spec.rb
pact_broker-2.22.0 spec/integration/ui/index_spec.rb
pact_broker-2.21.0 spec/integration/ui/index_spec.rb
pact_broker-2.20.0 spec/integration/ui/index_spec.rb
pact_broker-2.19.2 spec/integration/ui/index_spec.rb
pact_broker-2.19.1 spec/integration/ui/index_spec.rb
pact_broker-2.19.0 spec/integration/ui/index_spec.rb
pact_broker-2.18.0 spec/integration/ui/index_spec.rb
pact_broker-2.17.1 spec/integration/ui/index_spec.rb
pact_broker-2.17.0 spec/integration/ui/index_spec.rb