From f5f002a9460d58d8bc2e909d6be6a7784e26fa8c Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 18 May 2018 21:41:03 +1000 Subject: [PATCH] fix: add pact name back into title of deprecated pacts relation of provider pacts resource https://github.com/pact-foundation/pact_broker/issues/209 --- lib/pact_broker/api/decorators/provider_pacts_decorator.rb | 3 ++- .../api/decorators/provider_pacts_decorator_spec.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pact_broker/api/decorators/provider_pacts_decorator.rb b/lib/pact_broker/api/decorators/provider_pacts_decorator.rb index 881b901a8..4c8056189 100644 --- a/lib/pact_broker/api/decorators/provider_pacts_decorator.rb +++ b/lib/pact_broker/api/decorators/provider_pacts_decorator.rb @@ -21,6 +21,7 @@ class ProviderPactsDecorator < BaseDecorator } end + # TODO make the title and name consistent with title and name of other resources links :'pb:pacts' do | context | represented.collect do | pact | { @@ -35,7 +36,7 @@ class ProviderPactsDecorator < BaseDecorator represented.collect do | pact | { :href => pact_url(context[:base_url], pact), - :title => 'DEPRECATED - please use the pb:pacts relation', + :title => "DEPRECATED - please use the pb:pacts relation. #{pact.name}", :name => pact.consumer_name } end diff --git a/spec/lib/pact_broker/api/decorators/provider_pacts_decorator_spec.rb b/spec/lib/pact_broker/api/decorators/provider_pacts_decorator_spec.rb index c44409306..d8be5979e 100644 --- a/spec/lib/pact_broker/api/decorators/provider_pacts_decorator_spec.rb +++ b/spec/lib/pact_broker/api/decorators/provider_pacts_decorator_spec.rb @@ -40,7 +40,7 @@ module Decorators :name => "Foo" }], :pacts => [{ :href => "pact_url", - :title => "DEPRECATED - please use the pb:pacts relation", + :title => "DEPRECATED - please use the pb:pacts relation. Pact name", :name => "Foo" } ]