Sha256: 6b76e1231af9a9766e7c964a5297620ef62594039dce9382a11df33557ef93b7
Contents?: true
Size: 1.28 KB
Versions: 29
Compression:
Stored size: 1.28 KB
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 2 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 3 end end context "with the base_url not set" do it "returns relative links" do expect(subject.body).to include "href='/stylesheets" end end context "with the base_url set" do before do allow(PactBroker.configuration).to receive(:base_url).and_return('http://example.org/pact-broker') end it "returns absolute links" do expect(subject.body).to include "href='http://example.org/pact-broker/stylesheets" end end end end
Version data entries
29 entries across 29 versions & 1 rubygems