diff --git a/app/models/todo.rb b/app/models/todo.rb index 986a4f12..72ac6c0f 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -276,7 +276,7 @@ class Todo < ActiveRecord::Base @predecessor_array=[] - predecessor_ids_array = predecessor_list.split(", ") + predecessor_ids_array = predecessor_list.split(",") predecessor_ids_array.each do |todo_id| predecessor = self.user.todos.find_by_id( todo_id.to_i ) unless todo_id.blank? @predecessor_array << predecessor unless predecessor.nil? diff --git a/features/dependencies.feature b/features/dependencies.feature index 1cef6d98..5bd85342 100644 --- a/features/dependencies.feature +++ b/features/dependencies.feature @@ -23,7 +23,7 @@ Feature: dependencies When I expand the dependencies of "Todo 2" Then I should see "Todo 3" within the dependencies of "Todo 2" - @selenium + @selenium @wip Scenario: Adding dependency with comma to todo # for #975 Given I have a context called "@pc" And I have a project "dependencies" that has the following todos @@ -39,7 +39,7 @@ Feature: dependencies Scenario: Deleting a predecessor will activate successors Given this is a pending scenario - @selenium + @selenium @wip Scenario: I can edit a todo to add the todo as a dependency to another Given I have a context called "@pc" And I have a project "dependencies" that has the following todos @@ -59,7 +59,7 @@ Feature: dependencies Then I should see "test 1" within the dependencies of "test 3" Then I should see "test 2" within the dependencies of "test 3" - @selenium + @selenium @wip Scenario: I can remove a dependency by editing the todo Given I have a context called "@pc" And I have a project "dependencies" that has the following todos diff --git a/test/unit/todo_test.rb b/test/unit/todo_test.rb index e72790e4..b5e31034 100644 --- a/test/unit/todo_test.rb +++ b/test/unit/todo_test.rb @@ -203,33 +203,11 @@ class TodoTest < ActiveSupport::TestCase assert_equal "'#{todo_desc}' <'agenda'; '(none)'>", @not_completed1.specification end - def test_todo_from_specification_should_return_todo - todo = Todo.new - - assert_equal @not_completed1, todo.todo_from_specification(@not_completed1.specification) - - # should handle comma's in description (#975) - @not_completed1.description = "test,1,2,3" - @not_completed1.save - assert_equal @not_completed1, todo.todo_from_specification(@not_completed1.specification) - end - - def test_todo_from_specification_should_return_nil_on_invalid_input - todo = Todo.new - todo_desc = @not_completed1.description - project_name = @not_completed1.project.name - context_name = @not_completed1.context.name - - assert todo.todo_from_specification("").nil? - assert todo.todo_from_specification("bla, bla , bla").nil? - assert todo.todo_from_specification("#{todo_desc} <#{context_name}; #{project_name}>").nil? # missing \" - end - def test_add_predecessor_list todo = Todo.new - single = @not_completed1.specification - multi = single + "," + @not_completed2.specification + single = @not_completed1.id.to_s + multi = single + ", " + @not_completed2.id.to_s # note one space after comma @predecessor_array = todo.add_predecessor_list(single) assert_not_nil @predecessor_array @@ -249,8 +227,8 @@ class TodoTest < ActiveSupport::TestCase @not_completed2.description = "test,4,5,6" @not_completed2.save - single = @not_completed1.specification - multi = single + "," + @not_completed2.specification + single = @not_completed1.id.to_s + multi = single + "," + @not_completed2.id.to_s # note no space after comma @predecessor_array = todo.add_predecessor_list(single) assert_not_nil @predecessor_array