Sha256: e9f63012865fffef4b4b28718418f0851057dcf1c32a4af0a387eac4968323a1

Contents?: true

Size: 1.79 KB

Versions: 5

Compression:

Stored size: 1.79 KB

Contents

describe "retrieving a pact" do
  subject { get(path)  }

  context "when differing case is used in the consumer and provider names" do

    let(:path) { "/pacts/provider/a%20provider/consumer/a%20consumer/version/1.2.3A" }

    before do
      td.create_pact_with_hierarchy("A Consumer", "1.2.3a", "A Provider").and_return(:pact)
    end

    context "when case sensitivity is turned on" do
      before do
        allow(PactBroker.configuration).to receive(:use_case_sensitive_resource_names).and_return(true)
      end

      it "returns a 404 Not found" do
        expect(subject.status).to be 404
      end
    end

    context "when case sensitivity is turned off" do
      before do
        allow(PactBroker.configuration).to receive(:use_case_sensitive_resource_names).and_return(false)
      end

      it "returns a 200 Success" do
        expect(subject.status).to be 200
      end
    end
  end

  context "when differing case is used in the tag name" do

    let(:path) { "/pacts/provider/a%20provider/consumer/a%20consumer/latest/PROD" }

    before do
      td.create_consumer("A Consumer")
        .create_consumer_version("1.2.3")
        .create_consumer_version_tag("prod")
        .create_provider("A Provider")
        .create_pact
    end

    context "when case sensitivity is turned on" do
      before do
        allow(PactBroker.configuration).to receive(:use_case_sensitive_resource_names).and_return(true)
      end

      it "returns a 404 Not found" do
        expect(subject.status).to be 404
      end
    end

    context "when case sensitivity is turned off" do
      before do
        allow(PactBroker.configuration).to receive(:use_case_sensitive_resource_names).and_return(false)
      end

      it "returns a 200 Success" do
        expect(subject.status).to be 200
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/features/get_pact_spec.rb
pact_broker-2.89.0 spec/features/get_pact_spec.rb
pact_broker-2.88.0 spec/features/get_pact_spec.rb
pact_broker-2.87.0 spec/features/get_pact_spec.rb
pact_broker-2.86.0 spec/features/get_pact_spec.rb