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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 18:40:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 18:40:28 +0300
commitb595cb0c1dec83de5bdee18284abe86614bed33b (patch)
tree8c3d4540f193c5ff98019352f554e921b3a41a72 /spec/support/shared_examples/controllers
parent2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff)
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'spec/support/shared_examples/controllers')
-rw-r--r--spec/support/shared_examples/controllers/snowplow_event_tracking_examples.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/support/shared_examples/controllers/snowplow_event_tracking_examples.rb b/spec/support/shared_examples/controllers/snowplow_event_tracking_examples.rb
new file mode 100644
index 00000000000..98fc52add51
--- /dev/null
+++ b/spec/support/shared_examples/controllers/snowplow_event_tracking_examples.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+#
+# Requires a context containing:
+# - subject
+# - project
+# - feature_flag_name
+# - category
+# - action
+# - namespace
+# - user
+
+shared_examples 'Snowplow event tracking' do
+ let(:label) { nil }
+
+ it 'is not emitted if FF is disabled' do
+ stub_feature_flags(feature_flag_name => false)
+
+ subject
+
+ expect_no_snowplow_event
+ end
+
+ it 'is emitted' do
+ params = {
+ category: category,
+ action: action,
+ namespace: namespace,
+ user: user,
+ project: project,
+ label: label
+ }.compact
+
+ subject
+
+ expect_snowplow_event(**params)
+ end
+end