Sha256: a68d30607dbd123cfd594f3a2bc9149ee3f55fa8aeb27ad9ba7518282005cb19

Contents?: true

Size: 1.27 KB

Versions: 110

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 start_with expected_message
      end
    end
  end
end

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
pact_broker-2.79.1 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.79.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.78.1 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.78.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.77.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.76.2 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.76.1 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.76.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.75.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.74.1 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.74.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.73.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.72.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.71.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.70.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.69.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.68.1 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.68.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.67.0 spec/lib/pact_broker/messages_spec.rb
pact_broker-2.66.0 spec/lib/pact_broker/messages_spec.rb