mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-04 06:51:48 +01:00
Push conversion of a todo to a project down.
Refactor the conversion of a todo to a project and move it from the TodosController to the Project model.
This commit is contained in:
parent
2911036ff7
commit
b01c7878d1
3 changed files with 27 additions and 7 deletions
|
|
@ -166,5 +166,13 @@ class ProjectTest < ActiveSupport::TestCase
|
|||
@moremoney.todos[0].complete!
|
||||
assert_equal 3, @moremoney.todos.not_completed.count
|
||||
end
|
||||
|
||||
def test_convert_from_todo
|
||||
todo = todos(:upgrade_rails)
|
||||
project = Project.create_from_todo(todo)
|
||||
assert_equal project.name, todo.description
|
||||
assert_equal project.description, todo.notes
|
||||
assert_equal project.default_context, todo.context
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue