2020-12-16 04:10:26 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-02-01 07:09:03 -05:00
|
|
|
# Require the provided spec helper and matchers.
|
|
|
|
require 'gitlab/experiment/rspec'
|
|
|
|
|
2021-01-28 10:09:06 -05:00
|
|
|
# This is a temporary fix until we have a larger discussion around the
|
|
|
|
# challenges raised in https://gitlab.com/gitlab-org/gitlab/-/issues/300104
|
|
|
|
class ApplicationExperiment < Gitlab::Experiment # rubocop:disable Gitlab/NamespacedClass
|
2021-02-08 19:09:37 -05:00
|
|
|
def initialize(...)
|
|
|
|
super(...)
|
2021-02-03 10:09:24 -05:00
|
|
|
Feature.persist_used!(feature_flag_name)
|
2021-01-28 10:09:06 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-02-23 04:10:45 -05:00
|
|
|
RSpec.configure do |config|
|
|
|
|
# Disable all caching for experiments in tests.
|
|
|
|
config.before do
|
|
|
|
allow(Gitlab::Experiment::Configuration).to receive(:cache).and_return(nil)
|
|
|
|
end
|
|
|
|
end
|