diff --git a/app/views/todos/_edit_form.html.erb b/app/views/todos/_edit_form.html.erb index 66b5bd62..8bad0c27 100644 --- a/app/views/todos/_edit_form.html.erb +++ b/app/views/todos/_edit_form.html.erb @@ -22,7 +22,7 @@
- +
diff --git a/features/edit_a_todo.feature b/features/edit_a_todo.feature index 54b087c4..74fd8e92 100644 --- a/features/edit_a_todo.feature +++ b/features/edit_a_todo.feature @@ -243,6 +243,13 @@ Feature: Edit a next action from every page And I edit the project of "todo 1" to "" Then I should see the todo "todo 1" + @javascript + Scenario: I can edit a todo without a project and the project remains blank + Given I have a todo "todo 1" + When I go to the home page + And I change the todo[description] field of "todo 1" to "todo 1 edit" + Then I should see the todo "todo 1 edit" with project name "" + @javascript Scenario: I can edit a todo to move it to the tickler When I go to the home page diff --git a/features/step_definitions/todo_steps.rb b/features/step_definitions/todo_steps.rb index 2618d479..a0100249 100644 --- a/features/step_definitions/todo_steps.rb +++ b/features/step_definitions/todo_steps.rb @@ -162,3 +162,8 @@ Then /^I should (see|not see) the empty tickler message$/ do |see| elem = find("div#no_todos_in_view") expect(elem).send(see=="see" ? :to : :to_not, be_visible) end + +Then /^I should see the todo "([^"]*)" with project name "([^"]*)"$/ do |todo_description, project_name| + todo = @current_user.todos.where(:description => todo_description).first + expect(todo.project.name).to eq(project_name) +end