From 96891fec6dfa20a8342a3daa25935213cfddae22 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 22 Dec 2021 12:16:22 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/lib/gitlab/redis/multi_store_spec.rb | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'spec/lib/gitlab/redis') diff --git a/spec/lib/gitlab/redis/multi_store_spec.rb b/spec/lib/gitlab/redis/multi_store_spec.rb index 76731bb916c..663040e0ca7 100644 --- a/spec/lib/gitlab/redis/multi_store_spec.rb +++ b/spec/lib/gitlab/redis/multi_store_spec.rb @@ -646,6 +646,26 @@ RSpec.describe Gitlab::Redis::MultiStore do expect(multi_store.use_primary_and_secondary_stores?).to be false 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 describe '#use_primary_store_as_default?' do @@ -668,6 +688,26 @@ RSpec.describe Gitlab::Redis::MultiStore do expect(multi_store.use_primary_store_as_default?).to be false 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 def create_redis_store(options, extras = {}) -- cgit v1.2.3