Commit e737ffc4 authored by Phil Hughes's avatar Phil Hughes

Todo service tests

parent 16970d07
...@@ -220,6 +220,14 @@ describe TodoService, services: true do ...@@ -220,6 +220,14 @@ describe TodoService, services: true do
should_not_create_any_todo { service.new_note(note_on_project_snippet, john_doe) } should_not_create_any_todo { service.new_note(note_on_project_snippet, john_doe) }
end end
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 end
describe 'Merge Requests' do describe 'Merge Requests' do
...@@ -351,6 +359,14 @@ describe TodoService, services: true do ...@@ -351,6 +359,14 @@ describe TodoService, services: true do
expect(second_todo.reload).not_to be_done expect(second_todo.reload).not_to be_done
end end
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 end
def should_create_todo(attributes = {}) def should_create_todo(attributes = {})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment