diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /spec/lib/api/helpers/packages_helpers_spec.rb | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'spec/lib/api/helpers/packages_helpers_spec.rb')
-rw-r--r-- | spec/lib/api/helpers/packages_helpers_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/api/helpers/packages_helpers_spec.rb b/spec/lib/api/helpers/packages_helpers_spec.rb index b9c887b3e16..a3b21059334 100644 --- a/spec/lib/api/helpers/packages_helpers_spec.rb +++ b/spec/lib/api/helpers/packages_helpers_spec.rb @@ -238,4 +238,26 @@ RSpec.describe API::Helpers::PackagesHelpers do end end end + + describe '#track_package_event' do + before do + allow(helper).to receive(:current_user).and_return(user) + end + + it_behaves_like 'Snowplow event tracking with RedisHLL context' do + let(:action) { 'push_package' } + let(:scope) { :terraform_module } + let(:category) { described_class.name } + let(:namespace) { project.namespace } + let(:user) { project.creator } + let(:feature_flag_name) { nil } + let(:label) { 'redis_hll_counters.user_packages.user_packages_total_unique_counts_monthly' } + let(:property) { 'i_package_terraform_module_user' } + + subject(:package_action) do + args = { category: category, namespace: namespace, user: user, project: project } + helper.track_package_event(action, scope, **args) + end + end + end end |