-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tagged-pact-versions): ensure triggered webhooks are deleted whe…
…n pact versions are deleted
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
describe "Deleting tagged pact versions" do | ||
|
||
let(:path) { "/pacts/provider/Bar/consumer/Foo/tag/prod" } | ||
|
||
subject { delete(path) } | ||
|
||
context "when the pact exists" do | ||
before do | ||
TestDataBuilder.new | ||
.create_pact_with_hierarchy("Foo", "1.2.3", "Bar") | ||
.create_consumer_version_tag("prod") | ||
end | ||
|
||
it "deletes the pact" do | ||
expect{ subject }.to change{ PactBroker::Pacts::PactPublication.count }.by(-1) | ||
end | ||
|
||
it "returns a 204" do | ||
expect(subject.status).to be 204 | ||
end | ||
end | ||
|
||
context "when the pact does not exist" do | ||
it "returns a 404 Not Found" do | ||
expect(subject.status).to be 404 | ||
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