Sha256: ded1f59f1b55779eec8fc3fe09aa6442bd648526e9b0617e4e39da1b75bdd7e5

Contents?: true

Size: 884 Bytes

Versions: 45

Compression:

Stored size: 884 Bytes

Contents

describe "Deleting a pact" do

  let(:pact_content) { load_fixture('a_consumer-a_provider.json') }
  let(:path) { "/pacts/provider/A%20Provider/consumer/A%20Consumer/version/1.2.3" }
  let(:response_body_json) { JSON.parse(subject.body) }

  subject { delete path; last_response  }

  context "when the pact exists" do
    before do
      TestDataBuilder.new
        .create_pact_with_hierarchy("A Consumer", "1.2.3", "A Provider")
        .create_webhook
        .create_triggered_webhook
        .create_deprecated_webhook_execution
    end

    it "deletes the pact" do
      expect{ subject }.to change{ PactBroker::Pacts::PactPublication.count }.by(-1)
    end

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

  context "when the pact does not exist" do
    it "returns a 404 Not Found" do
      expect(subject.status).to be 404
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
pact_broker-2.30.0 spec/features/delete_pact_spec.rb
pact_broker-2.29.0 spec/features/delete_pact_spec.rb
pact_broker-2.27.6 spec/features/delete_pact_spec.rb
pact_broker-2.27.5 spec/features/delete_pact_spec.rb
pact_broker-2.27.4 spec/features/delete_pact_spec.rb
pact_broker-2.27.3 spec/features/delete_pact_spec.rb
pact_broker-2.27.2 spec/features/delete_pact_spec.rb
pact_broker-2.27.0 spec/features/delete_pact_spec.rb
pact_broker-2.26.1 spec/features/delete_pact_spec.rb
pact_broker-2.26.0 spec/features/delete_pact_spec.rb
pact_broker-2.25.0 spec/features/delete_pact_spec.rb
pact_broker-2.24.0 spec/features/delete_pact_spec.rb
pact_broker-2.23.4 spec/features/delete_pact_spec.rb
pact_broker-2.23.3 spec/features/delete_pact_spec.rb
pact_broker-2.23.2 spec/features/delete_pact_spec.rb
pact_broker-2.23.1 spec/features/delete_pact_spec.rb
pact_broker-2.23.0 spec/features/delete_pact_spec.rb
pact_broker-2.22.0 spec/features/delete_pact_spec.rb
pact_broker-2.21.0 spec/features/delete_pact_spec.rb
pact_broker-2.20.0 spec/features/delete_pact_spec.rb