chore: Remove account.destroy listener (#1530)

This commit is contained in:
Pranav Raj S
2020-12-19 18:11:43 +05:30
committed by GitHub
parent 090b716ec1
commit 8e2b4acc43
5 changed files with 13 additions and 33 deletions

View File

@@ -17,28 +17,9 @@ describe InstallationWebhookListener do
context 'when installation config is configured' do
it 'triggers webhook' do
create(:installation_config, name: 'INSTALLATION_EVENTS_WEBHOOK_URL', value: 'https://test.com')
expect(WebhookJob).to receive(:perform_later).with('https://test.com', account.webhook_data.merge(event: 'account_created')).once
expect(WebhookJob).to receive(:perform_later).with('https://test.com', account.webhook_data.merge(event: 'account_created', users: [])).once
listener.account_created(event)
end
end
end
describe '#account_destroyed' do
let(:event_name) { :'account.destroyed' }
context 'when installation config is not configured' do
it 'does not trigger webhook' do
expect(WebhookJob).to receive(:perform_later).exactly(0).times
listener.account_destroyed(event)
end
end
context 'when installation config is configured' do
it 'triggers webhook' do
create(:installation_config, name: 'INSTALLATION_EVENTS_WEBHOOK_URL', value: 'https://test.com')
expect(WebhookJob).to receive(:perform_later).with('https://test.com', account.webhook_data.merge(event: 'account_destroyed')).once
listener.account_destroyed(event)
end
end
end
end