diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-30 11:02:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-30 11:02:35 +0000 |
commit | 434a0ce52d75e13d48eac9ce83774954c7c5d48d (patch) | |
tree | de3b7a7cf1ce8b07555f28df592297c76894c90f /spec/lib/gitlab/experimentation_spec.rb | |
parent | 0a0d9493ca481c56b739a3df27c31262283150fe (diff) | |
download | gitlab-ce-334008db1f1929c3ef362c64cee5e6e973bccd70.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc2
Diffstat (limited to 'spec/lib/gitlab/experimentation_spec.rb')
-rw-r--r-- | spec/lib/gitlab/experimentation_spec.rb | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/spec/lib/gitlab/experimentation_spec.rb b/spec/lib/gitlab/experimentation_spec.rb index ebf98a0151f..4130d5f9184 100644 --- a/spec/lib/gitlab/experimentation_spec.rb +++ b/spec/lib/gitlab/experimentation_spec.rb @@ -13,7 +13,6 @@ RSpec.describe Gitlab::Experimentation::EXPERIMENTS do :invite_members_version_a, :invite_members_version_b, :invite_members_empty_group_version_a, - :new_create_project_ui, :contact_sales_btn_in_app, :customize_homepage, :invite_email, @@ -33,27 +32,25 @@ RSpec.describe Gitlab::Experimentation, :snowplow do before do stub_const('Gitlab::Experimentation::EXPERIMENTS', { backwards_compatible_test_experiment: { - environment: environment, tracking_category: 'Team', use_backwards_compatible_subject_index: true }, test_experiment: { - environment: environment, tracking_category: 'Team' } }) Feature.enable_percentage_of_time(:backwards_compatible_test_experiment_experiment_percentage, enabled_percentage) Feature.enable_percentage_of_time(:test_experiment_experiment_percentage, enabled_percentage) + allow(Gitlab).to receive(:com?).and_return(true) end - let(:environment) { Rails.env.test? } let(:enabled_percentage) { 10 } describe '.enabled?' do subject { described_class.enabled?(:test_experiment) } - context 'feature toggle is enabled, we are on the right environment and we are selected' do + context 'feature toggle is enabled and we are selected' do it { is_expected.to be_truthy } end @@ -68,20 +65,6 @@ RSpec.describe Gitlab::Experimentation, :snowplow do it { is_expected.to be_falsey } end - - describe 'we are on the wrong environment' do - let(:environment) { ::Gitlab.com? } - - it { is_expected.to be_falsey } - - it 'ensures the typically less expensive environment is checked before the more expensive call to database for Feature' do - expect_next_instance_of(described_class::Experiment) do |experiment| - expect(experiment).not_to receive(:enabled?) - end - - subject - end - end end describe '.enabled_for_value?' do |