Sha256: ae44bae28a86b13283810d5fcb5bb81ac2a2b3c144915710788317707e612f71

Contents?: true

Size: 895 Bytes

Versions: 7

Compression:

Stored size: 895 Bytes

Contents

describe "Deleting pact versions for branch" do

  let(:path) { "/pacts/provider/Bar/consumer/Foo/branch/main" }

  subject { delete(path)  }

  context "when the pact exists" do
    before do
      td.create_consumer("Foo")
        .create_provider("Bar")
        .create_consumer_version("1", branch: "main")
        .create_pact
        .create_consumer_version("2", branch: "not-main")
        .create_pact
        .create_consumer("NotFoo")
        .create_consumer_version("1", branch: "main")
        .create_pact
    end

    it "deletes the pacts for the relevant branch" 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

7 entries across 7 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/features/delete_pact_versions_for_branch_spec.rb
pact_broker-2.89.0 spec/features/delete_pact_versions_for_branch_spec.rb
pact_broker-2.88.0 spec/features/delete_pact_versions_for_branch_spec.rb
pact_broker-2.87.0 spec/features/delete_pact_versions_for_branch_spec.rb
pact_broker-2.86.0 spec/features/delete_pact_versions_for_branch_spec.rb
pact_broker-2.85.1 spec/features/delete_pact_versions_for_branch_spec.rb
pact_broker-2.85.0 spec/features/delete_pact_versions_for_branch_spec.rb