Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/stub_experiments.rb')
-rw-r--r--spec/support/helpers/stub_experiments.rb37
1 files changed, 0 insertions, 37 deletions
diff --git a/spec/support/helpers/stub_experiments.rb b/spec/support/helpers/stub_experiments.rb
deleted file mode 100644
index 8995b8f5f7b..00000000000
--- a/spec/support/helpers/stub_experiments.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-module StubExperiments
- # Stub Experiment with `key: true/false`
- #
- # @param [Hash] experiment where key is feature name and value is boolean whether active or not.
- #
- # Examples
- # - `stub_experiment(signup_flow: false)` ... Disables `signup_flow` experiment.
- def stub_experiment(experiments)
- allow(Gitlab::Experimentation).to receive(:active?).and_call_original
-
- experiments.each do |experiment_key, enabled|
- allow(Gitlab::Experimentation).to receive(:active?).with(experiment_key) { enabled }
- end
- end
-
- # Stub Experiment for user with `key: true/false`
- #
- # @param [Hash] experiment where key is feature name and value is boolean whether enabled or not.
- #
- # Examples
- # - `stub_experiment_for_subject(signup_flow: false)` ... Disable `signup_flow` experiment for user.
- def stub_experiment_for_subject(experiments)
- allow(Gitlab::Experimentation).to receive(:in_experiment_group?).and_call_original
-
- experiments.each do |experiment_key, enabled|
- allow(Gitlab::Experimentation).to receive(:in_experiment_group?).with(experiment_key, anything) { enabled }
- end
- end
-
- private
-
- def feature_flag_suffix
- Gitlab::Experimentation::Experiment::FEATURE_FLAG_SUFFIX
- end
-end