adjust webhooks
This commit is contained in:
@@ -52,14 +52,6 @@ RSpec.describe SendTemplateUpdatedWebhookRequestJob do
|
||||
).once
|
||||
end
|
||||
|
||||
it "doesn't send a webhook request if the template doesn't exist" do
|
||||
expect do
|
||||
described_class.new.perform('template_id' => 100_500, 'webhook_url_id' => webhook_url.id)
|
||||
end.to raise_error ActiveRecord::RecordNotFound
|
||||
|
||||
expect(WebMock).not_to have_requested(:post, webhook_url.url)
|
||||
end
|
||||
|
||||
it "doesn't send a webhook request if the event is not in the webhook's events" do
|
||||
webhook_url.update!(events: ['template.created'])
|
||||
|
||||
@@ -68,12 +60,6 @@ RSpec.describe SendTemplateUpdatedWebhookRequestJob do
|
||||
expect(WebMock).not_to have_requested(:post, webhook_url.url)
|
||||
end
|
||||
|
||||
it "doesn't send a webhook request if the webhook doesn't exist" do
|
||||
described_class.new.perform('template_id' => template.id, 'webhook_url_id' => 100_500)
|
||||
|
||||
expect(WebMock).not_to have_requested(:post, webhook_url.url)
|
||||
end
|
||||
|
||||
it 'sends again if the response status is 400 or higher' do
|
||||
stub_request(:post, webhook_url.url).to_return(status: 401)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user