diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 384c7057..cd59eda1 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -234,7 +234,9 @@ module TodosHelper } page.project { return (@todo.active? && @todo.project && @todo.project.id == @default_project.id) || - (@todo.project.hidden? && @todo.project_hidden?) || @todo.deferred? || @todo.pending? + (@todo.project.hidden? && @todo.project_hidden?) || + ( @todo.deferred? && (@todo.project.id == @default_project.id) ) || + @todo.pending? } end diff --git a/features/shared_add_new_todo.feature b/features/shared_add_new_todo.feature index f9bf7982..523446eb 100644 --- a/features/shared_add_new_todo.feature +++ b/features/shared_add_new_todo.feature @@ -128,6 +128,16 @@ Feature: Add new next action from every page When I go to the "another project" project Then I should see "can you see me?" + @selenium + Scenario: Adding a deferred todo to another project does not show the todo + # scenario for #1146 + Given I have a project called "another project" + When I go to the "test project" project + And I submit a deferred new action with description "a new next action" to project "another project" in the context "test context" + Then I should not see "a new next action" + And I submit a deferred new action with description "another new next action" to project "test project" in the context "test context" + Then I should see "another new next action" + @selenium Scenario Outline: Adding a todo with a new context shows the new context When I go to the diff --git a/features/step_definitions/todo_create_steps.rb b/features/step_definitions/todo_create_steps.rb index 8dc7dea3..9a9ee5b6 100644 --- a/features/step_definitions/todo_create_steps.rb +++ b/features/step_definitions/todo_create_steps.rb @@ -38,6 +38,10 @@ When /^I submit a new deferred action with description "([^"]*)" to project "([^ submit_next_action_form end +When /^I submit a deferred new action with description "([^"]*)" to project "([^"]*)" in the context "([^"]*)"$/ do |description, project_name, context_name| + When "I submit a new deferred action with description \"#{description}\" to project \"#{project_name}\" with tags \"\" in the context \"#{context_name}\"" +end + When /^I submit a new action with description "([^"]*)" to project "([^"]*)" with tags "([^"]*)" in the context "([^"]*)"$/ do |description, project_name, tags, context_name| fill_in "todo[description]", :with => description