Use spy over double.as_null_object

parent 6dbf8279
...@@ -13,7 +13,7 @@ describe Geo::GeoBackfillWorker, services: true do ...@@ -13,7 +13,7 @@ describe Geo::GeoBackfillWorker, services: true do
end end
it 'performs GeoSingleRepositoryBackfillWorker for each project' do it 'performs GeoSingleRepositoryBackfillWorker for each project' do
expect(GeoSingleRepositoryBackfillWorker).to receive(:new).twice.and_return(double.as_null_object) expect(GeoSingleRepositoryBackfillWorker).to receive(:new).twice.and_return(spy)
subject.perform subject.perform
end end
...@@ -29,7 +29,7 @@ describe Geo::GeoBackfillWorker, services: true do ...@@ -29,7 +29,7 @@ describe Geo::GeoBackfillWorker, services: true do
it 'does not perform GeoSingleRepositoryBackfillWorker for projects that repository exists' do it 'does not perform GeoSingleRepositoryBackfillWorker for projects that repository exists' do
create_list(:project, 2) create_list(:project, 2)
expect(GeoSingleRepositoryBackfillWorker).to receive(:new).twice.and_return(double.as_null_object) expect(GeoSingleRepositoryBackfillWorker).to receive(:new).twice.and_return(spy)
subject.perform subject.perform
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment