Improve spec coverage for collection of workers/
classes (#27874)
This commit is contained in:
parent
0a6ec048a8
commit
155fb84141
16 changed files with 460 additions and 8 deletions
|
@ -5,9 +5,21 @@ require 'rails_helper'
|
|||
describe Webhooks::DeliveryWorker do
|
||||
let(:worker) { described_class.new }
|
||||
|
||||
describe 'perform' do
|
||||
it 'runs without error' do
|
||||
expect { worker.perform(nil, nil) }.to_not raise_error
|
||||
describe '#perform' do
|
||||
let(:webhook) { Fabricate(:webhook) }
|
||||
|
||||
it 'reprocesses and updates the webhook' do
|
||||
stub_request(:post, webhook.url).to_return(status: 200, body: '')
|
||||
|
||||
worker.perform(webhook.id, 'body')
|
||||
|
||||
expect(a_request(:post, webhook.url)).to have_been_made.at_least_once
|
||||
end
|
||||
|
||||
it 'returns true for non-existent record' do
|
||||
result = worker.perform(123_123_123, '')
|
||||
|
||||
expect(result).to be(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue