Skip to content

Commit f5f002a

Browse files
committed
fix: add pact name back into title of deprecated pacts relation of provider pacts resource
pact-foundation#209
1 parent 7bd5344 commit f5f002a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/pact_broker/api/decorators/provider_pacts_decorator.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class ProviderPactsDecorator < BaseDecorator
2121
}
2222
end
2323

24+
# TODO make the title and name consistent with title and name of other resources
2425
links :'pb:pacts' do | context |
2526
represented.collect do | pact |
2627
{
@@ -35,7 +36,7 @@ class ProviderPactsDecorator < BaseDecorator
3536
represented.collect do | pact |
3637
{
3738
:href => pact_url(context[:base_url], pact),
38-
:title => 'DEPRECATED - please use the pb:pacts relation',
39+
:title => "DEPRECATED - please use the pb:pacts relation. #{pact.name}",
3940
:name => pact.consumer_name
4041
}
4142
end

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module Decorators
4040
:name => "Foo" }],
4141
:pacts => [{
4242
:href => "pact_url",
43-
:title => "DEPRECATED - please use the pb:pacts relation",
43+
:title => "DEPRECATED - please use the pb:pacts relation. Pact name",
4444
:name => "Foo"
4545
}
4646
]

0 commit comments

Comments
 (0)