Skip to content

Commit

Permalink
feat: allow all pacts between a given consumer and provider to be del…
Browse files Browse the repository at this point in the history
…eted at once
  • Loading branch information
bethesque committed Mar 31, 2019
1 parent 6470d19 commit 9f1ce9c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/pact_broker/api/resources/pact_versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def content_types_provided
end

def allowed_methods
["GET", "OPTIONS"]
["GET", "DELETE", "OPTIONS"]
end

def resource_exists?
Expand All @@ -29,6 +29,10 @@ def pacts
pact_service.find_all_pact_versions_between consumer_name, :and => provider_name
end

def delete_resource
pact_service.delete_all_pact_versions_between(consumer_name, and: provider_name)
true
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pact_broker/doc/views/consumer.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Consumer

Allowed methods: GET, PATCH, DELETE
Allowed methods: `GET`, `PATCH`, `DELETE`

The application that initiates the HTTP request.

Expand Down
10 changes: 10 additions & 0 deletions lib/pact_broker/doc/views/pact/all-pact-versions.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# All versions of a pact between a given consumer and provider

Allowed methods: `GET`, `DELETE`
Path: `/pacts/provider/{provider}/consumer/{consumer}/versions`

This resource returns a history of all the versions of the given pact between a consumer and provider.

## Deleting pacts

Sending a `DELETE` to this resource will delete all the pacts between the specified applications.

0 comments on commit 9f1ce9c

Please sign in to comment.