diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 9c9abd8f..2f61bf80 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -224,7 +224,8 @@ module TodosHelper page.todo { return !@todo.hidden? } page.deferred { return @todo.deferred? || @todo.pending? } page.context { - return @todo.context_id==@default_context.id && (!@todo.hidden? && !@todo.context.hidden?) + logger.debug "ci=#{@todo.context_id} dci=#{@default_context.id} th=#{@todo.hidden?} tch=#{@todo.context.hidden?}" + return @todo.context_id==@default_context.id && ( (@todo.hidden? && @todo.context.hidden?) || (!@todo.hidden?) ) } page.tag { return ( (@todo.pending? && @todo.has_tag?(@tag_name)) || diff --git a/features/shared_add_new_todo.feature b/features/shared_add_new_todo.feature index e62b4edf..0d7a8438 100644 --- a/features/shared_add_new_todo.feature +++ b/features/shared_add_new_todo.feature @@ -141,7 +141,7 @@ Feature: Add new next action from every page | visit | context page for "test context" | action | 1 | not be visible | | go to | tag page for "starred" | action | 1 | be visible | - @selenium @wip + @selenium Scenario Outline: Adding a todo to a hidden project does not show the todo Given I have a hidden project called "hidden project" And I have a project called "visible project" @@ -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 from home page 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 @@ -174,6 +174,17 @@ Feature: Add new next action from every page When I submit a new action with description "another new todo" in the context "hidden context" Then I should not see "another new todo" + @selenium + Scenario: Adding a todo to a context show the todo in that context page + Given I have a context called "visible context" + And I have a hidden context called "hidden context" + When I go to the context page for "visible context" + And I submit a new action with description "a new todo" in the context "visible context" + Then I should see "a new todo" + When I go to the context page for "hidden context" + And I submit a new action with description "another new todo" in the context "hidden context" + Then I should see "another new todo" + @selenium Scenario: Adding a todo to an empty container hides the empty message # TODO: make outline And I have a context called "visible context" @@ -191,7 +202,7 @@ Feature: Add new next action from every page 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 + And I submit the new multiple actions form with """ a @@ -220,4 +231,4 @@ Feature: Add new next action from every page """ - Then I should see "You need to submit at least one next action" \ No newline at end of file + Then I should see "You need to submit at least one next action" diff --git a/features/step_definitions/todo_steps.rb b/features/step_definitions/todo_steps.rb index 04e39fc2..aad984e0 100644 --- a/features/step_definitions/todo_steps.rb +++ b/features/step_definitions/todo_steps.rb @@ -90,7 +90,6 @@ end When /^I submit a new action with description "([^"]*)"$/ do |description| fill_in "todo[description]", :with => description submit_next_action_form - selenium.wait_for :wait_for => :ajax, :javascript_framework => :jquery end When /^I submit a new action with description "([^"]*)" and the tags "([^"]*)" in the context "([^"]*)"$/ do |description, tags, context_name| @@ -101,19 +100,17 @@ When /^I submit a new action with description "([^"]*)" and the tags "([^"]*)" i clear_context_name_from_next_action_form fill_in "todo_context_name", :with => context_name submit_next_action_form - selenium.wait_for :wait_for => :ajax, :javascript_framework => :jquery end When /^I submit a new deferred action with description "([^"]*)" and the tags "([^"]*)" in the context "([^"]*)"$/ do |description, tags, context_name| fill_in "todo[description]", :with => description clear_context_name_from_next_action_form - fill_in "context_name", :with => context_name + fill_in "todo_context_name", :with => context_name fill_in "tag_list", :with => tags fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week) submit_next_action_form - selenium.wait_for :wait_for => :ajax, :javascript_framework => :jquery end When /^I submit a new action with description "([^"]*)" to project "([^"]*)" with tags "([^"]*)" in the context "([^"]*)"$/ do |description, project_name, tags, context_name| @@ -123,21 +120,19 @@ When /^I submit a new action with description "([^"]*)" to project "([^"]*)" wit clear_context_name_from_next_action_form fill_in "todo_project_name", :with => project_name - fill_in "context_name", :with => context_name + fill_in "todo_context_name", :with => context_name fill_in "tag_list", :with => tags submit_next_action_form - selenium.wait_for :wait_for => :ajax, :javascript_framework => :jquery end When /^I submit a new action with description "([^"]*)" in the context "([^"]*)"$/ do |description, context_name| fill_in "todo[description]", :with => description clear_context_name_from_next_action_form - fill_in "context_name", :with => context_name + fill_in "todo_context_name", :with => context_name submit_next_action_form - selenium.wait_for :wait_for => :ajax, :javascript_framework => :jquery end When /^I submit multiple actions with using$/ do |multiple_actions|