Sha256: 404101ee6fdc545a95b8e625eab0f9466dceb37ca4572ebde2ec060fc5075fe5

Contents?: true

Size: 839 Bytes

Versions: 45

Compression:

Stored size: 839 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
    end

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

    it "returns a 200" do
      expect(subject.status).to be 200
    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.79.1 spec/features/delete_pact_spec.rb
pact_broker-2.79.0 spec/features/delete_pact_spec.rb
pact_broker-2.78.1 spec/features/delete_pact_spec.rb
pact_broker-2.78.0 spec/features/delete_pact_spec.rb
pact_broker-2.77.0 spec/features/delete_pact_spec.rb
pact_broker-2.76.2 spec/features/delete_pact_spec.rb
pact_broker-2.76.1 spec/features/delete_pact_spec.rb
pact_broker-2.76.0 spec/features/delete_pact_spec.rb
pact_broker-2.75.0 spec/features/delete_pact_spec.rb
pact_broker-2.74.1 spec/features/delete_pact_spec.rb
pact_broker-2.74.0 spec/features/delete_pact_spec.rb
pact_broker-2.73.0 spec/features/delete_pact_spec.rb
pact_broker-2.72.0 spec/features/delete_pact_spec.rb
pact_broker-2.71.0 spec/features/delete_pact_spec.rb
pact_broker-2.70.0 spec/features/delete_pact_spec.rb
pact_broker-2.69.0 spec/features/delete_pact_spec.rb
pact_broker-2.68.1 spec/features/delete_pact_spec.rb
pact_broker-2.68.0 spec/features/delete_pact_spec.rb
pact_broker-2.67.0 spec/features/delete_pact_spec.rb
pact_broker-2.66.0 spec/features/delete_pact_spec.rb