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/workers/post_receive_spec.rb')
-rw-r--r--spec/workers/post_receive_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb
index 3951c20c048..4ddb793516f 100644
--- a/spec/workers/post_receive_spec.rb
+++ b/spec/workers/post_receive_spec.rb
@@ -274,6 +274,32 @@ RSpec.describe PostReceive do
expect { perform }.to change { counter.read(:pushes) }.by(1)
end
+
+ it 'records correct payload with Snowplow event', :snowplow do
+ stub_feature_flags(route_hll_to_snowplow_phase2: true)
+
+ perform
+
+ expect_snowplow_event(
+ category: 'PostReceive',
+ action: 'source_code_pushes',
+ namespace: project.namespace,
+ user: project.first_owner,
+ project: project
+ )
+ end
+
+ context 'when FF is disabled' do
+ before do
+ stub_feature_flags(route_hll_to_snowplow_phase2: false)
+ end
+
+ it 'doesnt emit snowplow events', :snowplow do
+ perform
+
+ expect_no_snowplow_event
+ end
+ end
end
end