Sha256: ccd1a48e1416314dcf67edab6426359e1180387ec340590e49e207f757619166

Contents?: true

Size: 1.87 KB

Versions: 85

Compression:

Stored size: 1.87 KB

Contents

module PactBroker::Client
  describe Pacticipants, :pact => true do

    include_context "pact broker"

    let(:repository_url ) { "git@git.realestate.com.au:business-systems/pricing-service" }

    describe "registering a repository url" do
      context "where the pacticipant does not already exist in the pact-broker" do
        before do
          pact_broker.
            given("the 'Pricing Service' does not exist in the pact-broker").
            upon_receiving("a request to register the repository URL of a pacticipant").
            with(
                method: :patch,
                path: '/pacticipants/Pricing%20Service',
                headers: patch_request_headers,
                body: {repository_url: repository_url} ).
              will_respond_with(
                status: 201,
                headers: pact_broker_response_headers
              )
        end
        it "returns true" do
          expect(pact_broker_client.pacticipants.update({:pacticipant => 'Pricing Service', :repository_url => repository_url})).to be true
        end
      end
      context "where the 'Pricing Service' exists in the pact-broker" do
        before do
          pact_broker.
            given("the 'Pricing Service' already exists in the pact-broker").
            upon_receiving("a request to register the repository URL of a pacticipant").
            with(
              method: :patch,
              path: '/pacticipants/Pricing%20Service',
              headers: patch_request_headers,
              body: { repository_url: repository_url }).
            will_respond_with(
              status: 200,
              headers: pact_broker_response_headers
            )
        end
        it "returns true" do
          expect(pact_broker_client.pacticipants.update({:pacticipant => 'Pricing Service', :repository_url => repository_url})).to be true
        end
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
pact_broker-client-1.44.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.43.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.42.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.41.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.40.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.39.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.38.3 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.38.2 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.38.1 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.38.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.37.1 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.37.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.36.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.35.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.34.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.33.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.32.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.31.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.30.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.29.1 spec/service_providers/pact_broker_client_register_repository_spec.rb