diff --git a/lib/pact_broker/api/resources/badge.rb b/lib/pact_broker/api/resources/badge.rb index b65861a28..43ecb7cc2 100644 --- a/lib/pact_broker/api/resources/badge.rb +++ b/lib/pact_broker/api/resources/badge.rb @@ -58,8 +58,10 @@ def initials def comment consumer_version_number = pact ? pact.consumer_version_number : "?" + pact_revision = pact ? pact.revision_number : "?" provider_version_number = latest_verification ? latest_verification.provider_version_number : "?" - "\n" + verification_number = latest_verification ? latest_verification.number : "?" + "\n" end end end diff --git a/spec/lib/pact_broker/api/resources/badge_spec.rb b/spec/lib/pact_broker/api/resources/badge_spec.rb index 0c4da2056..13aefacb5 100644 --- a/spec/lib/pact_broker/api/resources/badge_spec.rb +++ b/spec/lib/pact_broker/api/resources/badge_spec.rb @@ -16,10 +16,10 @@ module Resources allow(PactBroker::Verifications::Status).to receive(:new).and_return(verification_status) end - let(:pact) { instance_double("PactBroker::Domain::Pact", consumer: consumer, provider: provider, consumer_version_number: "2") } + let(:pact) { instance_double("PactBroker::Domain::Pact", consumer: consumer, provider: provider, consumer_version_number: "2", revision_number: "1") } let(:consumer) { double('consumer') } let(:provider) { double('provider') } - let(:verification) { double("verification", provider_version_number: "3") } + let(:verification) { double("verification", provider_version_number: "3", number: "7") } let(:verification_status) { instance_double("PactBroker::Verifications::Status", to_sym: :verified) } @@ -86,7 +86,7 @@ module Resources end it "returns a comment with the consumer and provider numbers" do - expect(subject.body).to include "" + expect(subject.body).to include "" end context "when the label param is specified" do