Commit 11edb1a6 authored by Nikola Milojevic's avatar Nikola Milojevic

Merge branch 'fix_load_balancing_specs' into 'master'

Fix specs when load balanicng is configured

See merge request gitlab-org/gitlab!57107
parents f1e2873e 4090fed3
......@@ -134,6 +134,7 @@ RSpec.describe Gitlab::Database::LoadBalancing do
before do
subject.clear_configuration
allow(described_class).to receive(:hosts).and_return(%w(foo))
end
it 'returns false when no hosts are specified' do
......@@ -156,7 +157,6 @@ RSpec.describe Gitlab::Database::LoadBalancing do
end
it 'returns true when load balancing should be enabled' do
allow(described_class).to receive(:hosts).and_return(%w(foo))
allow(Gitlab::Runtime).to receive(:sidekiq?).and_return(false)
expect(described_class.enable?).to eq(true)
......@@ -176,6 +176,7 @@ RSpec.describe Gitlab::Database::LoadBalancing do
context 'without a license' do
before do
License.destroy_all # rubocop: disable Cop/DestroyAll
subject.clear_configuration
end
it 'is disabled' do
......@@ -237,6 +238,7 @@ RSpec.describe Gitlab::Database::LoadBalancing do
context 'without a license' do
before do
License.destroy_all # rubocop: disable Cop/DestroyAll
subject.clear_configuration
end
it 'is not configured' 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