From d932156dec24c85854c2badaf3d5501b7bb4b51b Mon Sep 17 00:00:00 2001 From: aakashb95 Date: Mon, 5 Jan 2026 18:14:59 +0530 Subject: [PATCH] fix spec --- .../jobs/captain/conversation/response_builder_job_spec.rb | 6 +++--- .../services/captain/assistant/agent_runner_service_spec.rb | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/enterprise/jobs/captain/conversation/response_builder_job_spec.rb b/spec/enterprise/jobs/captain/conversation/response_builder_job_spec.rb index 08a77626a..649353e9b 100644 --- a/spec/enterprise/jobs/captain/conversation/response_builder_job_spec.rb +++ b/spec/enterprise/jobs/captain/conversation/response_builder_job_spec.rb @@ -251,7 +251,7 @@ RSpec.describe Captain::Conversation::ResponseBuilderJob, type: :job do closed_all_day: true, open_all_day: false ) - allow(mock_llm_chat_service).to receive(:generate_response).and_return({ 'response' => 'conversation_handoff' }) + allow(mock_llm_chat_service).to receive(:generate_response).and_return({ 'action' => 'handoff' }) end it 'sends out of office message after handoff' do @@ -275,7 +275,7 @@ RSpec.describe Captain::Conversation::ResponseBuilderJob, type: :job do open_all_day: true, closed_all_day: false ) - allow(mock_llm_chat_service).to receive(:generate_response).and_return({ 'response' => 'conversation_handoff' }) + allow(mock_llm_chat_service).to receive(:generate_response).and_return({ 'action' => 'handoff' }) end it 'does not send out of office message after handoff' do @@ -321,7 +321,7 @@ RSpec.describe Captain::Conversation::ResponseBuilderJob, type: :job do closed_all_day: true, open_all_day: false ) - allow(mock_llm_chat_service).to receive(:generate_response).and_return({ 'response' => 'conversation_handoff' }) + allow(mock_llm_chat_service).to receive(:generate_response).and_return({ 'action' => 'handoff' }) end it 'does not send out of office message' do diff --git a/spec/enterprise/services/captain/assistant/agent_runner_service_spec.rb b/spec/enterprise/services/captain/assistant/agent_runner_service_spec.rb index 2c05860e2..931ebb74a 100644 --- a/spec/enterprise/services/captain/assistant/agent_runner_service_spec.rb +++ b/spec/enterprise/services/captain/assistant/agent_runner_service_spec.rb @@ -149,7 +149,8 @@ RSpec.describe Captain::Assistant::AgentRunnerService do expect(result).to eq({ 'response' => 'conversation_handoff', - 'reasoning' => 'Error occurred: Test error' + 'reasoning' => 'Error occurred: Test error', + 'action' => 'handoff' }) end @@ -170,6 +171,7 @@ RSpec.describe Captain::Assistant::AgentRunnerService do expect(result).to eq({ 'response' => 'conversation_handoff', + 'action' => 'handoff', 'reasoning' => 'Error occurred: Test error' }) end