diff --git a/lib/pact_broker/api/decorators/pact_decorator.rb b/lib/pact_broker/api/decorators/pact_decorator.rb index 6530706dc..06bbbbde5 100644 --- a/lib/pact_broker/api/decorators/pact_decorator.rb +++ b/lib/pact_broker/api/decorators/pact_decorator.rb @@ -56,8 +56,7 @@ def to_hash(options = {}) link :'pb:latest-pact-version' do | options | { - title: "Pact", - name: "Latest version of this pact", + title: "Latest version of this pact", href: latest_pact_url(options.fetch(:base_url), represented) } @@ -72,16 +71,14 @@ def to_hash(options = {}) link :'pb:latest-untagged-pact-version' do | options | { - title: "Pact", - name: "Latest untagged version of this pact", + title: "Latest untagged version of this pact", href: latest_untagged_pact_url(represented, options.fetch(:base_url)) } end link :'pb:latest-tagged-pact-version' do | options | { - title: "Pact", - name: "Latest tagged version of this pact", + title: "Latest tagged version of this pact", href: "#{latest_pact_url(options.fetch(:base_url), represented)}/{tag}", templated: true } @@ -89,16 +86,14 @@ def to_hash(options = {}) link :'pb:previous-distinct' do | options | { - title: "Pact", - name: "Previous distinct version of this pact", + title: "Previous distinct version of this pact", href: previous_distinct_pact_version_url(represented, options.fetch(:base_url)) } end link :'pb:diff-previous-distinct' do | options | { - title: "Diff", - name: "Diff with previous distinct version of this pact", + title: "Diff with previous distinct version of this pact", href: previous_distinct_diff_url(represented, options.fetch(:base_url)) } diff --git a/spec/lib/pact_broker/api/decorators/pact_decorator_spec.rb b/spec/lib/pact_broker/api/decorators/pact_decorator_spec.rb index 26c317839..57534f514 100644 --- a/spec/lib/pact_broker/api/decorators/pact_decorator_spec.rb +++ b/spec/lib/pact_broker/api/decorators/pact_decorator_spec.rb @@ -53,14 +53,12 @@ module Decorators it "includes a link to the diff with the previous distinct version" do expect(subject[:_links][:'pb:diff-previous-distinct']).to eq({href: 'http://example.org/pacts/provider/A%20Provider/consumer/A%20Consumer/version/1234/diff/previous-distinct', - title: 'Diff', - name: 'Diff with previous distinct version of this pact'}) + title: 'Diff with previous distinct version of this pact'}) end it "includes a link to the previous distinct pact version" do expect(subject[:_links][:'pb:previous-distinct']).to eq({href: 'http://example.org/pacts/provider/A%20Provider/consumer/A%20Consumer/version/1234/previous-distinct', - title: 'Pact', - name: 'Previous distinct version of this pact'}) + title: 'Previous distinct version of this pact'}) end it "includes a link to tag this version" do @@ -80,8 +78,7 @@ module Decorators end it "includes a link to the latest pact" do - expect(subject[:_links][:'pb:latest-pact-version'][:title]).to eq "Pact" - expect(subject[:_links][:'pb:latest-pact-version'][:name]).to eq "Latest version of this pact" + expect(subject[:_links][:'pb:latest-pact-version'][:title]).to eq "Latest version of this pact" expect(subject[:_links][:'pb:latest-pact-version'][:href]).to eq "http://example.org/pacts/provider/A%20Provider/consumer/A%20Consumer/latest" end