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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/todo_spec.rb')
-rw-r--r--spec/models/todo_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/todo_spec.rb b/spec/models/todo_spec.rb
index 651e2cf273f..7df22078c6d 100644
--- a/spec/models/todo_spec.rb
+++ b/spec/models/todo_spec.rb
@@ -114,6 +114,26 @@ RSpec.describe Todo do
end
end
+ describe '#for_issue_or_work_item?' do
+ it 'returns true when target is an Issue' do
+ subject.target_type = 'Issue'
+
+ expect(subject.for_issue_or_work_item?).to be_truthy
+ end
+
+ it 'returns true when target is a WorkItem' do
+ subject.target_type = 'WorkItem'
+
+ expect(subject.for_issue_or_work_item?).to be_truthy
+ end
+
+ it 'returns false when target is not an Issue' do
+ subject.target_type = 'DesignManagement::Design'
+
+ expect(subject.for_issue_or_work_item?).to be_falsey
+ end
+ end
+
describe '#target' do
context 'for commits' do
let(:project) { create(:project, :repository) }