forked from pact-foundation/pact_broker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add configuration option for check_for_potential_duplicate_pact…
…icipant_names This allows the checking for potential duplicate names (eg. a service being called "Foo" in one pact and "Foo Service" or "foo" or "Foos" in another) to be turned off when publishing a pact. Turning this check off will likely result in a mess of data, and result in the end of the world as we know it. Just for @uglyog
- Loading branch information
Showing
7 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,6 @@ def self.split(string) | |
.downcase | ||
.split("_") | ||
end | ||
|
||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require 'support/test_data_builder' | ||
|
||
describe "Creating a pacticipant" do | ||
let(:path) { "/pacticipants" } | ||
let(:headers) { {'CONTENT_TYPE' => 'application/json'} } | ||
let(:response_body) { JSON.parse(last_response.body, symbolize_names: true)} | ||
let(:pacticipant_hash) { {name: 'Foo Thing'}} | ||
|
||
subject { post path, pacticipant_hash.to_json, headers; last_response } | ||
|
||
it "returns a 201 response" do | ||
subject | ||
expect(last_response.status).to be 201 | ||
end | ||
|
||
it "returns the Location header" do | ||
subject | ||
expect(last_response.headers['Location']).to eq 'http://example.org/pacticpants/Foo%20Thing' | ||
end | ||
|
||
it "returns a JSON Content Type" do | ||
subject | ||
expect(last_response.headers['Content-Type']).to eq 'application/hal+json;charset=utf-8' | ||
end | ||
|
||
it "returns the newly created webhook" do | ||
subject | ||
expect(response_body).to include pacticipant_hash | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters