summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/controllers/unique_hll_events_examples.rb
blob: 842ad89bafd4b9486e40435ec9b91dce8786b8d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true
#
# Requires a context containing:
# - request
# - expected_type
# - target_id

RSpec.shared_examples 'tracking unique hll events' do
  it 'tracks unique event' do
    expect(Gitlab::UsageDataCounters::HLLRedisCounter).to(
      receive(:track_event)
        .with(target_id, values: expected_type)
        .and_call_original # we call original to trigger additional validations; otherwise the method is stubbed
    )

    request
  end
end