Commit 4090fed3 authored by nmilojevic1's avatar nmilojevic1 Committed by Quang-Minh Nguyen

Fix specs when load balanicng is configured

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