diff --git a/lib/pact_broker/pacticipants/repository.rb b/lib/pact_broker/pacticipants/repository.rb index e8a49ccf1..9fec7b4cf 100644 --- a/lib/pact_broker/pacticipants/repository.rb +++ b/lib/pact_broker/pacticipants/repository.rb @@ -67,8 +67,9 @@ def update(pacticipant_name, pacticipant) pacticipant.save end - def replace(_pacticipant_name, open_struct_pacticipant) + def replace(pacticipant_name, open_struct_pacticipant) PactBroker::Domain::Pacticipant.new( + name: pacticipant_name, display_name: open_struct_pacticipant.display_name, repository_url: open_struct_pacticipant.repository_url, repository_name: open_struct_pacticipant.repository_name, diff --git a/spec/lib/pact_broker/pacticipants/repository_spec.rb b/spec/lib/pact_broker/pacticipants/repository_spec.rb index 23505d29c..a858f448b 100644 --- a/spec/lib/pact_broker/pacticipants/repository_spec.rb +++ b/spec/lib/pact_broker/pacticipants/repository_spec.rb @@ -63,6 +63,7 @@ module Pacticipants subject { Repository.new.replace("Bar", OpenStruct.new(main_branch: "bar", repository_url: "new_url")) } it "replaces the pacticipant" do + expect(subject.name).to eq "Bar" expect(subject.main_branch).to eq "bar" expect(subject.repository_namespace).to eq nil expect(subject.display_name).to eq "display_name"