summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-13 14:25:58 +0100
committerPhil Hughes <me@iamphill.com>2016-06-14 08:36:07 +0100
commite737ffc48a4794d4dc8f58f20c973154eadff11b (patch)
tree96f2640c373e124e2a04392b2276b5b0b64357c7 /spec
parent16970d07e84f5967eccd928c9f9d9d7b027e91ac (diff)
downloadgitlab-ce-e737ffc48a4794d4dc8f58f20c973154eadff11b.tar.gz
Todo service tests
Diffstat (limited to 'spec')
-rw-r--r--spec/services/todo_service_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb
index 489c920f19f..5e46bfeebd9 100644
--- a/spec/services/todo_service_spec.rb
+++ b/spec/services/todo_service_spec.rb
@@ -220,6 +220,14 @@ describe TodoService, services: true do
should_not_create_any_todo { service.new_note(note_on_project_snippet, john_doe) }
end
end
+
+ describe '#mark_todo' do
+ it 'creates a todo from a issue' do
+ service.mark_todo(unassigned_issue, author)
+
+ should_create_todo(user: author, target: unassigned_issue, action: Todo::MARKED)
+ end
+ end
end
describe 'Merge Requests' do
@@ -351,6 +359,14 @@ describe TodoService, services: true do
expect(second_todo.reload).not_to be_done
end
end
+
+ describe '#mark_todo' do
+ it 'creates a todo from a merge request' do
+ service.mark_todo(mr_unassigned, author)
+
+ should_create_todo(user: author, target: mr_unassigned, action: Todo::MARKED)
+ end
+ end
end
def should_create_todo(attributes = {})