summaryrefslogtreecommitdiff
path: root/spec/services/todo_service_spec.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-08-11 19:00:06 +0200
committerRémy Coutable <remy@rymai.me>2016-08-13 00:06:12 +0200
commitaadc5062ebe755aaf3fbb27fdd0af093770c9ce8 (patch)
treeab50aadfdf1733ba6aec5ff8a036cc5d0f543341 /spec/services/todo_service_spec.rb
parent42e30a5012bb3384ee6f275ff058d4c0841776cd (diff)
downloadgitlab-ce-aadc5062ebe755aaf3fbb27fdd0af093770c9ce8.tar.gz
New TodoService#todo_exists? method
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/services/todo_service_spec.rb')
-rw-r--r--spec/services/todo_service_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb
index 34d8ea9090e..4c41df0d4f5 100644
--- a/spec/services/todo_service_spec.rb
+++ b/spec/services/todo_service_spec.rb
@@ -290,6 +290,18 @@ describe TodoService, services: true do
should_create_todo(user: author, target: unassigned_issue, action: Todo::MARKED)
end
end
+
+ describe '#todo_exists?' do
+ it 'returns false when no todo exist for the given issuable' do
+ expect(service.todo_exist?(unassigned_issue, author)).to be_falsy
+ end
+
+ it 'returns true when a todo exist for the given issuable' do
+ service.mark_todo(unassigned_issue, author)
+
+ expect(service.todo_exist?(unassigned_issue, author)).to be_truthy
+ end
+ end
end
describe 'Merge Requests' do