test(captain): simplify classifier model spec

This commit is contained in:
aakashb95
2026-05-04 17:14:57 +05:30
parent 563be4ac2f
commit 9f2076664e
@@ -67,15 +67,15 @@ RSpec.describe Captain::Llm::AssistantActionClassifierService do
)
end
it 'uses the configured Captain model from the base LLM service' do
create(:installation_config, name: 'CAPTAIN_OPEN_AI_MODEL', value: 'provider/custom-model')
it 'uses the configured Captain model' do
create(:installation_config, name: 'CAPTAIN_OPEN_AI_MODEL', value: 'gpt-4.1-nano')
expect(RubyLLM).to receive(:chat).with(model: 'provider/custom-model').and_return(mock_chat)
expect(RubyLLM).to receive(:chat).with(model: 'gpt-4.1-nano').and_return(mock_chat)
allow(mock_chat).to receive(:ask).and_return(mock_response)
result = service.classify(message_history: message_history, assistant_response: 'Would you like to talk to support?')
expect(result).to include('model' => 'provider/custom-model')
expect(result).to include('model' => 'gpt-4.1-nano')
end
context 'when the assistant has no custom instructions' do