Enhancement: Add event name in webhook payload (#528)

* chore: Remove unwanted twitter gem
* Enhancement: Add event name in webhook payload
fixes #528 #516 #518
This commit is contained in:
Subin T P
2020-02-20 16:19:42 +05:30
committed by GitHub
parent 813cdd8aec
commit d36e1b52f6
4 changed files with 3 additions and 28 deletions

View File

@@ -24,8 +24,8 @@ describe WebhookListener do
context 'when webhook is configured' do
it 'triggers webhook' do
create(:webhook, inbox: inbox, account: account)
expect(WebhookJob).to receive(:perform_later).once
webhook = create(:webhook, inbox: inbox, account: account)
expect(WebhookJob).to receive(:perform_later).with(webhook.urls[0], message.push_event_data.merge(event: 'message_created')).once
listener.message_created(event)
end
end