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>2021-01-26 18:08:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-26 18:08:58 +0300
commitff89c3c372cd3b317915fb21940f9c8c065d94c0 (patch)
treece6674c2d661f25ffc156679846b0d6b48247e8e /spec/support/helpers/snowplow_helpers.rb
parent0121231095b3a50a18aaf4eb4a7058b55fe62fc1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/helpers/snowplow_helpers.rb')
-rw-r--r--spec/support/helpers/snowplow_helpers.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/support/helpers/snowplow_helpers.rb b/spec/support/helpers/snowplow_helpers.rb
index 70a4eadd8de..a6de8dabdac 100644
--- a/spec/support/helpers/snowplow_helpers.rb
+++ b/spec/support/helpers/snowplow_helpers.rb
@@ -46,7 +46,7 @@ module SnowplowHelpers
# }
# ]
# )
- def expect_snowplow_event(category:, action:, context: nil, **kwargs)
+ def expect_snowplow_event(category:, action:, context: nil, standard_context: nil, **kwargs)
if context
kwargs[:context] = []
context.each do |c|
@@ -56,6 +56,14 @@ module SnowplowHelpers
end
end
+ if standard_context
+ expect(Gitlab::Tracking::StandardContext)
+ .to have_received(:new)
+ .with(**standard_context)
+
+ kwargs[:standard_context] = an_instance_of(Gitlab::Tracking::StandardContext)
+ end
+
expect(Gitlab::Tracking).to have_received(:event) # rubocop:disable RSpec/ExpectGitlabTracking
.with(category, action, **kwargs).at_least(:once)
end