Restructure omni services and add Chatwoot research snapshot
This commit is contained in:
22
research/chatwoot/spec/jobs/agent_bots/webhook_job_spec.rb
Normal file
22
research/chatwoot/spec/jobs/agent_bots/webhook_job_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AgentBots::WebhookJob do
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
subject(:job) { described_class.perform_later(url, payload, webhook_type) }
|
||||
|
||||
let(:url) { 'https://test.com' }
|
||||
let(:payload) { { name: 'test' } }
|
||||
let(:webhook_type) { :agent_bot_webhook }
|
||||
|
||||
it 'queues the job' do
|
||||
expect { job }.to have_enqueued_job(described_class)
|
||||
.with(url, payload, webhook_type)
|
||||
.on_queue('high')
|
||||
end
|
||||
|
||||
it 'executes perform' do
|
||||
expect(Webhooks::Trigger).to receive(:execute).with(url, payload, webhook_type)
|
||||
perform_enqueued_jobs { job }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user