mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
retain tags from action when transforming into project
This commit is contained in:
parent
db62ebd074
commit
229c515e71
2 changed files with 8 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ class ProjectFromTodo
|
||||||
p.name = todo.description
|
p.name = todo.description
|
||||||
p.description = todo.notes
|
p.description = todo.notes
|
||||||
p.default_context = todo.context
|
p.default_context = todo.context
|
||||||
|
p.default_tags = todo.tag_list
|
||||||
p.user = todo.user
|
p.user = todo.user
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ class ProjectFromTodoTest < ActiveSupport::TestCase
|
||||||
assert_equal project.default_context, todo.context
|
assert_equal project.default_context, todo.context
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_retain_tags_from_todo
|
||||||
|
todo = todos(:upgrade_rails)
|
||||||
|
todo.tag_with "a, b"
|
||||||
|
project = ProjectFromTodo.new(todo).create
|
||||||
|
assert_equal "a, b", project.default_tags
|
||||||
|
end
|
||||||
|
|
||||||
def test_invalid_project_from_invalid_todo
|
def test_invalid_project_from_invalid_todo
|
||||||
todo = todos(:upgrade_rails)
|
todo = todos(:upgrade_rails)
|
||||||
todo.description = ""
|
todo.description = ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue