Skip to content

Commit 0c8106b

Browse files
committed
feat: allow all pacts between a given consumer and provider to be deleted at once
1 parent 03e156c commit 0c8106b

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

lib/pact_broker/api/resources/pact_versions.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def content_types_provided
1313
end
1414

1515
def allowed_methods
16-
["GET", "OPTIONS"]
16+
["GET", "DELETE", "OPTIONS"]
1717
end
1818

1919
def resource_exists?
@@ -29,6 +29,10 @@ def pacts
2929
pact_service.find_all_pact_versions_between consumer_name, :and => provider_name
3030
end
3131

32+
def delete_resource
33+
pact_service.delete_all_pact_versions_between(consumer_name, and: provider_name)
34+
true
35+
end
3236
end
3337
end
3438
end

lib/pact_broker/doc/views/consumer.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Consumer
22

3-
Allowed methods: GET, PATCH, DELETE
3+
Allowed methods: `GET`, `PATCH`, `DELETE`
44

55
The application that initiates the HTTP request.
66

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# All versions of a pact between a given consumer and provider
2+
3+
Allowed methods: `GET`, `DELETE`
4+
Path: `/pacts/provider/{provider}/consumer/{consumer}/versions`
5+
6+
This resource returns a history of all the versions of the given pact between a consumer and provider.
7+
8+
## Deleting pacts
9+
10+
Sending a `DELETE` to this resource will delete all the pacts between the specified applications.

0 commit comments

Comments
 (0)