blob: 0ab5dec8ecf1268291057d257d7e4386d28852c7 (
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
48
49
50
51
52
53
54
55
|
# 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
describe '.track_work_item_todo_marked_action' do
subject(:track_event) { described_class.track_work_item_mark_todo_action(author: user) }
let(:event_name) { described_class::WORK_ITEM_TODO_MARKED }
it_behaves_like 'work item unique counter'
end
end
|