diff options
Diffstat (limited to 'spec/models/work_item_spec.rb')
-rw-r--r-- | spec/models/work_item_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/work_item_spec.rb b/spec/models/work_item_spec.rb index 2fa1abda44a..e92ae746911 100644 --- a/spec/models/work_item_spec.rb +++ b/spec/models/work_item_spec.rb @@ -10,4 +10,16 @@ RSpec.describe WorkItem do expect(work_item.noteable_target_type_name).to eq('issue') end end + + describe 'callbacks' do + describe 'record_create_action' do + it 'records the creation action after saving' do + expect(Gitlab::UsageDataCounters::WorkItemActivityUniqueCounter).to receive(:track_work_item_created_action) + # During the work item transition we also want to track work items as issues + expect(Gitlab::UsageDataCounters::IssueActivityUniqueCounter).to receive(:track_issue_created_action) + + create(:work_item) + end + end + end end |