0
0
Fork 0

Worker specs coverage increase (#32541)

This commit is contained in:
Matt Jankowski 2024-10-23 03:50:20 -04:00 committed by GitHub
parent bd0c826a3d
commit d1b20ea8f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 186 additions and 15 deletions

View file

@ -7,9 +7,7 @@ RSpec.describe AccountRefreshWorker do
let(:service) { instance_double(ResolveAccountService, call: true) }
describe '#perform' do
before do
allow(ResolveAccountService).to receive(:new).and_return(service)
end
before { stub_service }
context 'when account does not exist' do
it 'returns immediately without processing' do
@ -48,5 +46,11 @@ RSpec.describe AccountRefreshWorker do
(Account::BACKGROUND_REFRESH_INTERVAL + 3.days).ago
end
end
def stub_service
allow(ResolveAccountService)
.to receive(:new)
.and_return(service)
end
end
end