From 118270d2e8e55b58714fb6cc0df60453b909134f Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Mon, 6 Apr 2026 16:45:47 +0400 Subject: [PATCH] fix(agent-bot): Update listener spec to match signed webhook arguments (#14006) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes failing `agent_bot_listener_spec.rb` tests for `conversation_status_changed` events. After #13892 added webhook signing, `process_webhook_bot_event` passes `:agent_bot_webhook` and `secret:`/`delivery_id:` kwargs to `AgentBots::WebhookJob.perform_later`, but two spec expectations were not updated to match the new call signature. ## What changed - Updated `perform_later` expectations in `conversation_status_changed` specs to include the `:agent_bot_webhook` type and `secret` keyword arguments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Muhsin <12408980+muhsin-k@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) --- spec/listeners/agent_bot_listener_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/listeners/agent_bot_listener_spec.rb b/spec/listeners/agent_bot_listener_spec.rb index c74ca450c..08deeb6c4 100644 --- a/spec/listeners/agent_bot_listener_spec.rb +++ b/spec/listeners/agent_bot_listener_spec.rb @@ -82,7 +82,9 @@ describe AgentBotListener do create(:agent_bot_inbox, inbox: inbox, agent_bot: agent_bot) expect(AgentBots::WebhookJob).to receive(:perform_later).with( agent_bot.outgoing_url, - hash_including(event: 'conversation_status_changed', changed_attributes: anything) + hash_including(event: 'conversation_status_changed', changed_attributes: anything), + :agent_bot_webhook, + hash_including(secret: agent_bot.secret) ).once listener.conversation_status_changed(event) end @@ -96,7 +98,9 @@ describe AgentBotListener do it 'sends webhook to the assigned agent bot' do expect(AgentBots::WebhookJob).to receive(:perform_later).with( agent_bot.outgoing_url, - hash_including(event: 'conversation_status_changed', changed_attributes: anything) + hash_including(event: 'conversation_status_changed', changed_attributes: anything), + :agent_bot_webhook, + hash_including(secret: agent_bot.secret) ).once listener.conversation_status_changed(event) end