diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/lib/gitlab/experimentation | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) | |
download | gitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/lib/gitlab/experimentation')
-rw-r--r-- | spec/lib/gitlab/experimentation/controller_concern_spec.rb | 10 | ||||
-rw-r--r-- | spec/lib/gitlab/experimentation/experiment_spec.rb | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/spec/lib/gitlab/experimentation/controller_concern_spec.rb b/spec/lib/gitlab/experimentation/controller_concern_spec.rb index 03cb89ee033..c47f71c207d 100644 --- a/spec/lib/gitlab/experimentation/controller_concern_spec.rb +++ b/spec/lib/gitlab/experimentation/controller_concern_spec.rb @@ -156,6 +156,16 @@ RSpec.describe Gitlab::Experimentation::ControllerConcern, type: :controller do is_expected.to eq(true) end end + + context 'Cookie parameter to force enable experiment' do + it 'returns true unconditionally' do + cookies[:force_experiment] = 'test_experiment,another_experiment' + get :index + + expect(check_experiment(:test_experiment)).to eq(true) + expect(check_experiment(:another_experiment)).to eq(true) + end + end end describe '#track_experiment_event', :snowplow do diff --git a/spec/lib/gitlab/experimentation/experiment_spec.rb b/spec/lib/gitlab/experimentation/experiment_spec.rb index 7b1d1763010..008e6699597 100644 --- a/spec/lib/gitlab/experimentation/experiment_spec.rb +++ b/spec/lib/gitlab/experimentation/experiment_spec.rb @@ -14,8 +14,10 @@ RSpec.describe Gitlab::Experimentation::Experiment do end before do - feature = double('FeatureFlag', percentage_of_time_value: percentage ) - expect(Feature).to receive(:get).with(:experiment_key_experiment_percentage).and_return(feature) + skip_feature_flags_yaml_validation + skip_default_enabled_yaml_check + 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) } |