Commit d4264944 authored by alinamihaila's avatar alinamihaila

Use global feature

parent 35dc4932
......@@ -31,7 +31,7 @@ module RedisTrackingHelper
private
def metric_feature_enabled?(event_name)
Feature.enabled?("redis_hll_#{event_name}", current_user)
Feature.enabled?("redis_hll_#{event_name}")
end
def visitor_id
......
......@@ -10,7 +10,7 @@ RSpec.describe RedisTrackingHelper do
let(:current_user) { create(:user) }
before do
stub_feature_flags(redis_hll_g_compliance_dashboard: current_user)
stub_feature_flags(redis_hll_g_compliance_dashboard: true)
end
it 'does not track event if feature flag disabled' do
......@@ -45,10 +45,10 @@ RSpec.describe RedisTrackingHelper do
helper.track_unique_redis_hll_event(event_name)
end
it 'does not tracks event if user is not logged in, but has the cookie already' do
it 'tracks event if user is not logged in, but has the cookie already' do
helper.request.cookies[:visitor_id] = { value: SecureRandom.uuid, expires: 24.months }
expect(Gitlab::UsageDataCounters::HLLRedisCounter).not_to receive(:track_event)
expect(Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:track_event)
helper.track_unique_redis_hll_event(event_name)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment