diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/lib/api/helpers_spec.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/lib/api/helpers_spec.rb')
-rw-r--r-- | spec/lib/api/helpers_spec.rb | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/spec/lib/api/helpers_spec.rb b/spec/lib/api/helpers_spec.rb index 51a45dff6a4..8e738af0fa3 100644 --- a/spec/lib/api/helpers_spec.rb +++ b/spec/lib/api/helpers_spec.rb @@ -191,41 +191,32 @@ RSpec.describe API::Helpers do describe '#increment_unique_values' do let(:value) { '9f302fea-f828-4ca9-aef4-e10bd723c0b3' } - let(:event_name) { 'my_event' } + let(:event_name) { 'g_compliance_dashboard' } let(:unknown_event) { 'unknown' } let(:feature) { "usage_data_#{event_name}" } + before do + skip_feature_flags_yaml_validation + end + context 'with feature enabled' do before do stub_feature_flags(feature => true) end it 'tracks redis hll event' do - stub_application_setting(usage_ping_enabled: true) - expect(Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:track_event).with(value, event_name) subject.increment_unique_values(event_name, value) end - it 'does not track event usage ping is not enabled' do - stub_application_setting(usage_ping_enabled: false) - expect(Gitlab::UsageDataCounters::HLLRedisCounter).not_to receive(:track_event) - - subject.increment_unique_values(event_name, value) - end - it 'logs an exception for unknown event' do - stub_application_setting(usage_ping_enabled: true) - expect(Gitlab::AppLogger).to receive(:warn).with("Redis tracking event failed for event: #{unknown_event}, message: Unknown event #{unknown_event}") subject.increment_unique_values(unknown_event, value) end it 'does not track event for nil values' do - stub_application_setting(usage_ping_enabled: true) - expect(Gitlab::UsageDataCounters::HLLRedisCounter).not_to receive(:track_event) subject.increment_unique_values(unknown_event, nil) |