diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/lib/gitlab/experimentation/experiment_spec.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/lib/gitlab/experimentation/experiment_spec.rb')
-rw-r--r-- | spec/lib/gitlab/experimentation/experiment_spec.rb | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/spec/lib/gitlab/experimentation/experiment_spec.rb b/spec/lib/gitlab/experimentation/experiment_spec.rb deleted file mode 100644 index a5cc69b9538..00000000000 --- a/spec/lib/gitlab/experimentation/experiment_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::Experimentation::Experiment do - using RSpec::Parameterized::TableSyntax - - let(:percentage) { 50 } - let(:params) do - { - tracking_category: 'Category1', - rollout_strategy: nil - } - end - - before do - skip_feature_flags_yaml_validation - skip_default_enabled_yaml_check - allow(Feature).to receive(:log_feature_flag_states?).and_return(false) - feature = double('FeatureFlag', percentage_of_time_value: percentage, enabled?: true) - allow(Feature).to receive(:get).with(:experiment_key_experiment_percentage).and_return(feature) - end - - subject(:experiment) { described_class.new(:experiment_key, **params) } - - describe '#active?' do - before do - allow(Gitlab).to receive(:com?).and_return(on_gitlab_com) - end - - subject { experiment.active? } - - where(:on_gitlab_com, :percentage, :is_active) do - true | 0 | false - true | 10 | true - false | 0 | false - false | 10 | false - end - - with_them do - it { is_expected.to eq(is_active) } - end - end - - describe '#enabled_for_index?' do - subject { experiment.enabled_for_index?(index) } - - where(:index, :percentage, :is_enabled) do - 50 | 40 | false - 40 | 50 | true - nil | 50 | false - end - - with_them do - it { is_expected.to eq(is_enabled) } - end - end -end |