diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-08 15:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-08 15:09:24 +0300 |
commit | b0d4724e47f94c9b1b2676382084ef964200e3c1 (patch) | |
tree | ce6fc40991e049c022b01a37cbecea12c3285405 /spec/workers | |
parent | 058e1a233fc1d96917c72cfab552c72db93f4f8b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/post_receive_spec.rb | 26 |
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 |