-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add endpoint to return latest pact for consumer, provider and c…
…onsumer branch
- Loading branch information
Showing
6 changed files
with
52 additions
and
3 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
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,22 @@ | ||
describe "retrieving the latest pact for a branch" do | ||
let(:path) { "/pacts/provider/Provider/consumer/Consumer/branch/main/latest" } | ||
let(:json_response_body) { JSON.parse(subject.body, symbolize_names: true) } | ||
|
||
subject { get(path) } | ||
|
||
before do | ||
td.create_consumer("Consumer") | ||
.create_provider("Provider") | ||
.create_consumer_version("1", branch: "main") | ||
.create_pact | ||
.create_consumer_version("2", branch: "main") | ||
.create_pact | ||
.create_consumer_version("3", branch: "foo") | ||
.create_pact | ||
.create_consumer_version("4", branch: "main") | ||
end | ||
|
||
it "returns the latest pact for the branch" do | ||
expect(json_response_body[:_links][:self][:href]).to end_with("2") | ||
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