Welcome to mirror list, hosted at ThFree Co, Russian Federation.

work_item_activity_unique_counter_spec.rb « usage_data_counters « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aaf509b6f81642f3806bccd8bc4e5bdb96fb0e48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::UsageDataCounters::WorkItemActivityUniqueCounter, :clean_gitlab_redis_shared_state do
  let(:user) { build(:user, id: 1) }

  describe '.track_work_item_created_action' do
    subject(:track_event) { described_class.track_work_item_created_action(author: user) }

    let(:event_name) { described_class::WORK_ITEM_CREATED }

    it_behaves_like 'work item unique counter'
  end

  describe '.track_work_item_title_changed_action' do
    subject(:track_event) { described_class.track_work_item_title_changed_action(author: user) }

    let(:event_name) { described_class::WORK_ITEM_TITLE_CHANGED }

    it_behaves_like 'work item unique counter'
  end

  describe '.track_work_item_date_changed_action' do
    subject(:track_event) { described_class.track_work_item_date_changed_action(author: user) }

    let(:event_name) { described_class::WORK_ITEM_DATE_CHANGED }

    it_behaves_like 'work item unique counter'
  end

  describe '.track_work_item_labels_changed_action' do
    subject(:track_event) { described_class.track_work_item_labels_changed_action(author: user) }

    let(:event_name) { described_class::WORK_ITEM_LABELS_CHANGED }

    it_behaves_like 'work item unique counter'
  end

  describe '.track_work_item_milestone_changed_action' do
    subject(:track_event) { described_class.track_work_item_milestone_changed_action(author: user) }

    let(:event_name) { described_class::WORK_ITEM_MILESTONE_CHANGED }

    it_behaves_like 'work item unique counter'
  end
end