chore: refine Rails.root.join stub in spec
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user