Commit ebbe1879 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'spec-improvements' into 'master'

Use expect_any_instance_of not to receive on repository backfill spec

See merge request !1477
parents 636e1023 83e6de25
...@@ -68,15 +68,9 @@ describe Geo::RepositoryBackfillService, services: true do ...@@ -68,15 +68,9 @@ describe Geo::RepositoryBackfillService, services: true do
let(:project) { create(:project) } let(:project) { create(:project) }
it 'does not fetch the project repositories' do it 'does not fetch the project repositories' do
fetch_count = 0 expect_any_instance_of(Repository).not_to receive(:fetch_geo_mirror)
allow_any_instance_of(Repository).to receive(:fetch_geo_mirror) do
fetch_count += 1
end
subject.execute subject.execute
expect(fetch_count).to eq 0
end end
context 'tracking database' do context 'tracking database' do
...@@ -87,7 +81,7 @@ describe Geo::RepositoryBackfillService, services: true do ...@@ -87,7 +81,7 @@ describe Geo::RepositoryBackfillService, services: true do
end end
context 'when repository was backfilled' do context 'when repository was backfilled' do
let(:project) { create(:project) } let(:project) { create(:project) }
let!(:registry) do let!(:registry) do
Geo::ProjectRegistry.create( Geo::ProjectRegistry.create(
...@@ -98,15 +92,9 @@ describe Geo::RepositoryBackfillService, services: true do ...@@ -98,15 +92,9 @@ describe Geo::RepositoryBackfillService, services: true do
end end
it 'does not fetch the project repositories' do it 'does not fetch the project repositories' do
fetch_count = 0 expect_any_instance_of(Repository).not_to receive(:fetch_geo_mirror)
allow_any_instance_of(Repository).to receive(:fetch_geo_mirror) do
fetch_count += 1
end
subject.execute subject.execute
expect(fetch_count).to eq 0
end end
context 'tracking database' do context 'tracking database' do
......
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