If you want to keep consistency in your tests, but setting the expectations at last you need to add in your setup:
setup do
allow(Rails.logger).to receive(:info)
end
...
it 'should log an info message' do
{code}
expect(Rails.logger).to have_received(:info).with('Starting the worker...')
end