summaryrefslogtreecommitdiff
path: root/spec/initializers/sidekiq_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/initializers/sidekiq_spec.rb')
-rw-r--r--spec/initializers/sidekiq_spec.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/initializers/sidekiq_spec.rb b/spec/initializers/sidekiq_spec.rb
new file mode 100644
index 00000000000..e34f59c3427
--- /dev/null
+++ b/spec/initializers/sidekiq_spec.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'sidekiq' do
+ describe 'enable_reliable_fetch?' do
+ subject { enable_reliable_fetch? }
+
+ context 'when gitlab_sidekiq_reliable_fetcher is enabled' do
+ before do
+ stub_feature_flags(gitlab_sidekiq_reliable_fetcher: true)
+ end
+
+ it { is_expected.to be_truthy }
+ end
+
+ context 'when gitlab_sidekiq_reliable_fetcher is disabled' do
+ before do
+ stub_feature_flags(gitlab_sidekiq_reliable_fetcher: false)
+ end
+
+ it { is_expected.to be_falsey }
+ end
+ end
+
+ describe 'enable_semi_reliable_fetch_mode?' do
+ subject { enable_semi_reliable_fetch_mode? }
+
+ context 'when gitlab_sidekiq_enable_semi_reliable_fetcher is enabled' do
+ before do
+ stub_feature_flags(gitlab_sidekiq_enable_semi_reliable_fetcher: true)
+ end
+
+ it { is_expected.to be_truthy }
+ end
+
+ context 'when gitlab_sidekiq_enable_semi_reliable_fetcher is disabled' do
+ before do
+ stub_feature_flags(gitlab_sidekiq_enable_semi_reliable_fetcher: false)
+ end
+
+ it { is_expected.to be_falsey }
+ end
+ end
+end