diff --git a/lib/pact_broker/pacticipants/service.rb b/lib/pact_broker/pacticipants/service.rb index 1741a5556..ea2912049 100644 --- a/lib/pact_broker/pacticipants/service.rb +++ b/lib/pact_broker/pacticipants/service.rb @@ -86,6 +86,7 @@ def self.delete name connection.run("delete from pact_versions where consumer_id = #{pacticipant.id}") connection.run("delete from versions where pacticipant_id = #{pacticipant.id}") version_repository.delete_by_id version_ids + label_repository.delete_by_pacticipant_id(pacticipant.id) connection.run("delete from pacticipants where id = #{pacticipant.id}") end diff --git a/spec/lib/pact_broker/pacticipants/service_spec.rb b/spec/lib/pact_broker/pacticipants/service_spec.rb index ede55f4a4..91a23c54c 100644 --- a/spec/lib/pact_broker/pacticipants/service_spec.rb +++ b/spec/lib/pact_broker/pacticipants/service_spec.rb @@ -116,6 +116,7 @@ module Pacticipants before do TestDataBuilder.new .create_consumer("Consumer") + .create_label("finance") .create_consumer_version("2.3.4") .create_provider("Provider") .create_pact