Commit d4662859 authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Add more specs (fix undercoverage)

parent 4749cc22
...@@ -646,6 +646,26 @@ RSpec.describe Gitlab::Redis::MultiStore do ...@@ -646,6 +646,26 @@ RSpec.describe Gitlab::Redis::MultiStore do
expect(multi_store.use_primary_and_secondary_stores?).to be false expect(multi_store.use_primary_and_secondary_stores?).to be false
end end
end end
context 'with empty DB' do
before do
allow(Feature::FlipperFeature).to receive(:table_exists?).and_return(false)
end
it 'multi store is disabled' do
expect(multi_store.use_primary_and_secondary_stores?).to be false
end
end
context 'when FF table guard raises' do
before do
allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise
end
it 'multi store is disabled' do
expect(multi_store.use_primary_and_secondary_stores?).to be false
end
end
end end
describe '#use_primary_store_as_default?' do describe '#use_primary_store_as_default?' do
...@@ -668,6 +688,26 @@ RSpec.describe Gitlab::Redis::MultiStore do ...@@ -668,6 +688,26 @@ RSpec.describe Gitlab::Redis::MultiStore do
expect(multi_store.use_primary_store_as_default?).to be false expect(multi_store.use_primary_store_as_default?).to be false
end end
end end
context 'with empty DB' do
before do
allow(Feature::FlipperFeature).to receive(:table_exists?).and_return(false)
end
it 'multi store is disabled' do
expect(multi_store.use_primary_and_secondary_stores?).to be false
end
end
context 'when FF table guard raises' do
before do
allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise
end
it 'multi store is disabled' do
expect(multi_store.use_primary_and_secondary_stores?).to be false
end
end
end end
def create_redis_store(options, extras = {}) def create_redis_store(options, extras = {})
......
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