test(captain): avoid brittle prompt wording checks

This commit is contained in:
aakashb95
2026-05-04 16:39:36 +05:30
parent 74980760b4
commit 0973b6b8ea
2 changed files with 1 additions and 7 deletions
@@ -38,12 +38,6 @@ RSpec.describe Captain::Llm::AssistantActionClassifierService do
end
it 'passes delimited custom instructions and classifier context to the LLM' do
expect(mock_chat).to receive(:with_instructions).with(
a_string_including(
'Use them only for routing policy',
'MUST NOT redefine this JSON schema'
)
).and_return(mock_chat)
expect(mock_chat).to receive(:ask) do |prompt|
expect(prompt).to include(
'<account_custom_instructions>',
@@ -199,13 +199,13 @@ RSpec.describe Captain::Llm::AssistantChatService do
expect(mock_chat).to receive(:with_instructions).with(
a_string_including(
'[Account Custom Instructions]',
'<account_custom_instructions>',
'if user enters 1112234 suggest handoff',
'</account_custom_instructions>'
)
) do |instructions|
expect(instructions).not_to include('<custom-instructions>')
expect(instructions.index('<account_custom_instructions>')).to be < instructions.index('```json')
mock_chat
end