diff options
Diffstat (limited to 'spec/lib/api/helpers')
-rw-r--r-- | spec/lib/api/helpers/packages_helpers_spec.rb | 22 | ||||
-rw-r--r-- | spec/lib/api/helpers/rate_limiter_spec.rb | 3 |
2 files changed, 23 insertions, 2 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 diff --git a/spec/lib/api/helpers/rate_limiter_spec.rb b/spec/lib/api/helpers/rate_limiter_spec.rb index 2fed1cf3604..3640c7e30e7 100644 --- a/spec/lib/api/helpers/rate_limiter_spec.rb +++ b/spec/lib/api/helpers/rate_limiter_spec.rb @@ -19,8 +19,7 @@ RSpec.describe API::Helpers::RateLimiter do @current_user = current_user end - def render_api_error!(**args) - end + def render_api_error!(**args); end end end |