mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
fix error where empty line causes server error
This commit is contained in:
parent
30983b6658
commit
bf5e378301
2 changed files with 33 additions and 12 deletions
|
|
@ -162,17 +162,19 @@ class TodosController < ApplicationController
|
|||
|
||||
@todos = []
|
||||
params[:todo][:multiple_todos].split("\n").map do |line|
|
||||
@todo = current_user.todos.build(
|
||||
:description => line)
|
||||
@todo.project_id = @project_id
|
||||
@todo.context_id = @context_id
|
||||
@saved = @todo.save
|
||||
unless (@saved == false) || tag_list.blank?
|
||||
@todo.tag_with(tag_list)
|
||||
@todo.tags.reload
|
||||
unless line.blank?
|
||||
@todo = current_user.todos.build(
|
||||
:description => line)
|
||||
@todo.project_id = @project_id
|
||||
@todo.context_id = @context_id
|
||||
@saved = @todo.save
|
||||
unless (@saved == false) || tag_list.blank?
|
||||
@todo.tag_with(tag_list)
|
||||
@todo.tags.reload
|
||||
end
|
||||
@todos << @todo
|
||||
@not_done_todos << @todo if @new_context_created
|
||||
end
|
||||
@todos << @todo
|
||||
@not_done_todos << @todo if @new_context_created
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ Feature: Add new next action from every page
|
|||
| tag page for "test" | see | see |
|
||||
|
||||
@selenium
|
||||
Scenario: Adding a todo to a hidden context does not show the todo
|
||||
Scenario: Adding a todo to a hidden context does not show the todo
|
||||
Given I have a context called "visible context"
|
||||
And I have a hidden context called "hidden context"
|
||||
When I go to the home page
|
||||
|
|
@ -186,6 +186,25 @@ Feature: Add new next action from every page
|
|||
Scenario: Adding a dependency to a todo updated the successor
|
||||
Given this is a pending scenario
|
||||
|
||||
@selenium
|
||||
Scenario: I can add multiple todos in a new project and a new context
|
||||
When I go to the home page
|
||||
And I follow "Add multiple next actions"
|
||||
And I fill the multiple actions form with "", "a next project", "@anywhere", "new tag"
|
||||
And I submit the new multiple actions form with
|
||||
"""
|
||||
|
||||
a
|
||||
b
|
||||
c
|
||||
|
||||
|
||||
"""
|
||||
Then I should see "@anywhere"
|
||||
And I should see "a"
|
||||
And I should see "b"
|
||||
And I should see "c"
|
||||
|
||||
@selenium
|
||||
Scenario: I need to fill in at least one description and a context
|
||||
When I go to the home page
|
||||
|
|
@ -200,4 +219,4 @@ Feature: Add new next action from every page
|
|||
|
||||
|
||||
"""
|
||||
Then I should see "You need to submit at least one next action"
|
||||
Then I should see "You need to submit at least one next action"
|
||||
Loading…
Add table
Add a link
Reference in a new issue