Sha256: 66e97c6d93db2e56fac424881cf027e0229174298a0c3119905c50a2a3491b02

Contents?: true

Size: 1.2 KB

Versions: 20

Compression:

Stored size: 1.2 KB

Contents

require 'pact_broker/versions/service'

module PactBroker

  module Versions
    describe Service do
      describe ".delete" do
        let(:td) { TestDataBuilder.new }
        let!(:version) do
          td
            .create_consumer
            .create_provider
            .create_consumer_version("1.2.3")
            .create_consumer_version_tag("prod")
            .create_pact
            .create_verification(provider_version: "1.0.0")
            .and_return(:consumer_version)
        end

        subject { Service.delete(version) }

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

        it "deletes the tags" do
          expect{ subject }.to change { PactBroker::Domain::Tag.count }.by(-1)
        end

        it "deletes the version" do
          expect{ subject }.to change { PactBroker::Domain::Version.count }.by(-1)
        end

        context "when deleting a provider version" do
          it "deletes associated verifications" do
            expect { Service.delete(td.provider_version ) }. to change { PactBroker::Domain::Verification.count }.by(-1)
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pact_broker-2.36.1 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.36.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.35.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.34.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.33.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.32.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.31.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.30.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.29.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.27.6 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.27.5 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.27.4 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.27.3 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.27.2 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.27.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.26.1 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.26.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.25.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.24.0 spec/lib/pact_broker/versions/service_spec.rb
pact_broker-2.23.4 spec/lib/pact_broker/versions/service_spec.rb