提交 e737ffc4 编写于 作者: P Phil Hughes

Todo service tests

上级 16970d07
......@@ -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 = {})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册