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_feature_flags.rb')
-rw-r--r--spec/support/helpers/stub_feature_flags.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/support/helpers/stub_feature_flags.rb b/spec/support/helpers/stub_feature_flags.rb
index 7cebda700d3..42bb9982144 100644
--- a/spec/support/helpers/stub_feature_flags.rb
+++ b/spec/support/helpers/stub_feature_flags.rb
@@ -25,6 +25,15 @@ module StubFeatureFlags
Feature.reset_flipper
end
+ def stub_with_new_feature_current_request
+ return unless Gitlab::SafeRequestStore.active?
+
+ new_request = Feature::FlipperRequest.new
+ allow(new_request).to receive(:id).and_return(SecureRandom.uuid)
+
+ allow(Feature).to receive(:current_request).and_return(new_request)
+ end
+
# Stub Feature flags with `flag_name: true/false`
#
# @param [Hash] features where key is feature name and value is boolean whether enabled or not.