Commit 6a8e9b2a authored by Mike Kozono's avatar Mike Kozono Committed by Douglas Barbosa Alexandre

Isolate the test

In preparation for adding verification to another replicator.
parent 85f03822
......@@ -406,7 +406,7 @@ RSpec.describe Gitlab::Geo, :geo, :request_store do
context 'when there are no Replicator classes with verification enabled' do
it 'returns the total capacity' do
stub_feature_flags(geo_package_file_verification: false)
allow(described_class).to receive(:verification_enabled_replicator_classes).and_return([])
expect(described_class.verification_max_capacity_per_replicator_class).to eq(verification_max_capacity)
end
......@@ -414,10 +414,20 @@ RSpec.describe Gitlab::Geo, :geo, :request_store do
context 'when there is 1 Replicator class with verification enabled' do
it 'returns half capacity' do
allow(described_class).to receive(:verification_enabled_replicator_classes).and_return(['a replicator class'])
expect(described_class.verification_max_capacity_per_replicator_class).to eq(verification_max_capacity / 2)
end
end
context 'when there are 2 Replicator classes with verification enabled' do
it 'returns a third of total capacity' do
allow(described_class).to receive(:verification_enabled_replicator_classes).and_return(['a replicator class', 'another replicator class'])
expect(described_class.verification_max_capacity_per_replicator_class).to eq(verification_max_capacity / 3)
end
end
context 'when total capacity is set lower than the number of Replicators' do
let(:verification_max_capacity) { 1 }
......
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