Sha256: f1aaef3b032e4300301b13433d003e5ae3ea49f9e5f30de597bb09ca91ef39e9

Contents?: true

Size: 1.27 KB

Versions: 46

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'
require 'pact_broker/messages'

module PactBroker
  module Messages


    describe "#potential_duplicate_pacticipant_message" do
      let(:new_name) { 'Contracts' }
      let(:fred) { double('Contracts Service', name: 'Contracts Service') }
      let(:frederich) { double('Accepted Contracts', name: 'Accepted Contracts') }
      let(:potential_duplicate_pacticipants) { [fred, frederich]}

      let(:expected_message) { String.new <<-EOS
This is the first time a pact has been published for "Contracts".
The name "Contracts" is very similar to the following existing consumers/providers:
* Contracts Service
* Accepted Contracts
If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact.
If the pact is intended to be for a new consumer or provider, please manually create "Contracts" using the following command, and then re-publish the pact:
$ curl -v -XPOST -H "Content-Type: application/json" -d "{\\\"name\\\": \\\"Contracts\\\"}" http://example.org/pacticipants
EOS
      }
      subject { Messages.potential_duplicate_pacticipant_message new_name, potential_duplicate_pacticipants, 'http://example.org' }

      it "returns a message" do
        expect(subject).to eq expected_message
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
pact_broker-2.2.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.1.1 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.1.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.5 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.4 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.3 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.2 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.1 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.0.beta.8 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.0.beta.7 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.0.beta.6 spec/lib/pact_broker/messages_spec.rb
pact_broker-1.18.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.0.beta.5 spec/lib/pact_broker/messages_spec.rb
pact_broker-1.18.0.beta.1 spec/lib/pact_broker/messages_spec.rb
pact_broker-1.17.2 spec/lib/pact_broker/messages_spec.rb
pact_broker-1.17.1 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.0.beta.4 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.0.beta.3 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.0.0.beta.2 spec/lib/pact_broker/messages_spec.rb