Skip to content

Commit

Permalink
feat(webhooks): use consumer/provider names in webhook title
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Jun 17, 2019
1 parent f4a1b68 commit 2b5d249
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/pact_broker/api/decorators/webhooks_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class WebhooksDecorator < BaseDecorator
links :'pb:webhooks' do | context |
represented.entries.collect do | webhook |
{
title: "Webhook",
title: webhook.scope_description,
name: webhook.display_description,
href: webhook_url(webhook.uuid, context[:base_url])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module Decorators
let(:webhook) do
instance_double(Domain::Webhook,
uuid: 'some-uuid',
display_description: 'description'
display_description: 'description',
scope_description: 'scope description'
)
end
let(:base_url) { 'http://example.org' }
Expand All @@ -34,7 +35,7 @@ module Decorators

it "includes a list of links to the webhooks" do
expect(subject[:_links][:'pb:webhooks']).to be_instance_of(Array)
expect(subject[:_links][:'pb:webhooks'].first).to eq title: 'Webhook', name: 'description', href: 'http://example.org/webhooks/some-uuid'
expect(subject[:_links][:'pb:webhooks'].first).to eq title: 'scope description', name: 'description', href: 'http://example.org/webhooks/some-uuid'
end

it "includes curies" do
Expand Down

0 comments on commit 2b5d249

Please sign in to comment.