chore: refine Rails.root.join stub in spec

This commit is contained in:
Muhsin
2026-03-11 14:13:03 +04:00
parent 0c6d44c05d
commit 4c49e7a4fb
+4 -1
View File
@@ -280,7 +280,10 @@ RSpec.describe Captain::BaseTaskService do
describe '#prompt_from_file' do
it 'reads prompt from file' do
allow(Rails.root).to receive(:join).and_return(instance_double(Pathname, read: 'Test prompt content'))
allow(Rails.root).to receive(:join).and_call_original
allow(Rails.root).to receive(:join)
.with('lib/integrations/openai/openai_prompts', 'test.liquid')
.and_return(instance_double(Pathname, read: 'Test prompt content'))
expect(service.send(:prompt_from_file, 'test')).to eq('Test prompt content')
end
end