debian-mirror-gitlab/spec/models/work_item_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
776 B
Ruby
Raw Normal View History

2022-04-04 11:22:00 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe WorkItem do
describe '#noteable_target_type_name' do
it 'returns `issue` as the target name' do
work_item = build(:work_item)
expect(work_item.noteable_target_type_name).to eq('issue')
end
end
2022-05-07 20:08:51 +05:30
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
2022-04-04 11:22:00 +05:30
end