Skip to content

Commit ec24e99

Browse files
committed
fix: correct URL of tag relation in pacticipant version resource
1 parent a6c54fb commit ec24e99

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/pact_broker/api/decorators/version_decorator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class VersionDecorator < BaseDecorator
2828

2929
link :'pb:tag' do | options |
3030
{
31-
href: pacticipant_url(options.fetch(:base_url), represented.pacticipant) + '/tags/{tag}',
31+
href: version_url(options.fetch(:base_url), represented) + '/tags/{tag}',
3232
title: "Get, create or delete a tag for this pacticipant version",
3333
templated: true
3434
}

spec/lib/pact_broker/api/decorators/version_decorator_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ module Decorators
4242
expect(subject[:_links][:'pb:pacticipant']).to eq title: "Pacticipant", name: "Consumer", href: "http://example.org/pacticipants/Consumer"
4343
end
4444

45+
it "includes a link to get, create or delete a tag" do
46+
expect(subject[:_links][:'pb:tag']).to include href: "http://example.org/pacticipants/Consumer/versions/1.2.3/tags/{tag}", templated: true
47+
end
48+
4549
it "includes a list of the tags" do
4650
expect(subject[:_embedded][:tags]).to be_instance_of(Array)
4751
expect(subject[:_embedded][:tags].first[:name]).to eq "prod"

0 commit comments

Comments
 (0)