Skip to content

Commit e109a8c

Browse files
nenadbethesque
authored andcommitted
fix(frontend): remove 'v' prefix on versions during render (pact-foundation#313)
This prevents confusion when looking at versions in the frontend, and seeing things like `vv1.0.0` or `vfd1245b` where the first 'v' is artificially added.
1 parent 294bfd8 commit e109a8c

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

lib/pact_broker/domain/pact.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def to_json options = {}
4747
end
4848

4949
def name
50-
"Pact between #{consumer.name} (v#{consumer_version_number}) and #{provider.name}"
50+
"Pact between #{consumer.name} (#{consumer_version_number}) and #{provider.name}"
5151
end
5252

5353
def version_and_updated_date

lib/pact_broker/matrix/row.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def compare_name_asc name1, name2
215215
end
216216

217217
def to_s
218-
"#{consumer_name} v#{consumer_version_number} #{provider_name} #{provider_version_number} #{success}"
218+
"#{consumer_name} #{consumer_version_number} #{provider_name} #{provider_version_number} #{success}"
219219
end
220220

221221
def compare_number_desc number1, number2

lib/pact_broker/ui/view_models/index_item.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ def warning?
151151
def verification_tooltip
152152
case @relationship.pseudo_branch_verification_status
153153
when :success
154-
"Successfully verified by #{provider_name} (v#{short_version_number(@relationship.latest_verification_provider_version_number)})"
154+
"Successfully verified by #{provider_name} (#{short_version_number(@relationship.latest_verification_provider_version_number)})"
155155
when :stale
156-
"Pact has changed since last successful verification by #{provider_name} (v#{short_version_number(@relationship.latest_verification_provider_version_number)})"
156+
"Pact has changed since last successful verification by #{provider_name} (#{short_version_number(@relationship.latest_verification_provider_version_number)})"
157157
when :failed
158-
"Verification by #{provider_name} (v#{short_version_number(@relationship.latest_verification_provider_version_number)}) failed"
158+
"Verification by #{provider_name} (#{short_version_number(@relationship.latest_verification_provider_version_number)}) failed"
159159
else
160160
nil
161161
end

spec/lib/pact_broker/pacts/diff_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ module Pacts
5959
subject { Diff.new.process(pact_params.merge(base_url: 'http://example.org'), comparison_pact_params) }
6060

6161
it "compares the two pacts" do
62-
expect(subject).to include "Pact between Consumer (v3) and Provider"
63-
expect(subject).to include "Pact between Consumer (v4) and Provider"
62+
expect(subject).to include "Pact between Consumer (3) and Provider"
63+
expect(subject).to include "Pact between Consumer (4) and Provider"
6464
end
6565

6666
it "includes a link to the comparison pact", pending: true do

spec/lib/pact_broker/ui/view_models/index_item_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,21 @@ module ViewDomain
5252
let(:pseudo_branch_verification_status) { :stale }
5353
its(:pseudo_branch_verification_status) { is_expected.to eq "warning" }
5454
its(:warning?) { is_expected.to be true }
55-
its(:verification_tooltip) { is_expected.to eq "Pact has changed since last successful verification by Foo (v4.5.6)" }
55+
its(:verification_tooltip) { is_expected.to eq "Pact has changed since last successful verification by Foo (4.5.6)" }
5656
end
5757

5858
context "when the pact has not changed since the last successful verification" do
5959
let(:pseudo_branch_verification_status) { :success }
6060
its(:pseudo_branch_verification_status) { is_expected.to eq "success" }
6161
its(:warning?) { is_expected.to be false }
62-
its(:verification_tooltip) { is_expected.to eq "Successfully verified by Foo (v4.5.6)" }
62+
its(:verification_tooltip) { is_expected.to eq "Successfully verified by Foo (4.5.6)" }
6363
end
6464

6565
context "when the pact verification failed" do
6666
let(:pseudo_branch_verification_status) { :failed }
6767
its(:pseudo_branch_verification_status) { is_expected.to eq "danger" }
6868
its(:warning?) { is_expected.to be false }
69-
its(:verification_tooltip) { is_expected.to eq "Verification by Foo (v4.5.6) failed" }
69+
its(:verification_tooltip) { is_expected.to eq "Verification by Foo (4.5.6) failed" }
7070
end
7171
end
7272

0 commit comments

Comments
 (0)