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.27.10 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.27.9 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.27.8 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.27.4 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.27.2 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.27.1 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.27.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.26.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.25.1 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.25.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.24.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.23.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.22.3 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.22.2 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.22.1 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.21.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.20.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.19.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.18.0 spec/service_providers/pact_broker_client_register_repository_spec.rb
pact_broker-client-1.17.0 spec/service_providers/pact_broker_client_register_repository_spec.rb