Navigation Menu

Skip to content

Commit

Permalink
Default project should be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Giaccone committed Aug 13, 2015
1 parent 8a378aa commit 336f19c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/todos/_edit_form.html.erb
Expand Up @@ -22,7 +22,7 @@

<div class="project_input">
<label for="<%= dom_id(@todo, 'project_name') %>"><%= t('common.project') %></label>
<input id="<%= dom_id(@todo, 'project_name') %>" name="project_name" autocomplete="off" size="30" type="text" value="<%= @todo.project.nil? ? 'None' : h(@todo.project.name) %>" />
<input id="<%= dom_id(@todo, 'project_name') %>" name="project_name" autocomplete="off" size="30" type="text" value="<%= @todo.project.nil? ? '' : h(@todo.project.name) %>" />
</div>

<div class="context_input">
Expand Down
7 changes: 7 additions & 0 deletions features/edit_a_todo.feature
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions features/step_definitions/todo_steps.rb
Expand Up @@ -162,3 +162,8 @@
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

0 comments on commit 336f19c

Please sign in to comment.