From 37ded2a7f84cadbed2a882c9c383919c4781d619 Mon Sep 17 00:00:00 2001 From: Sebastian Fischmeister Date: Mon, 20 Feb 2012 21:56:36 -0500 Subject: [PATCH] Fix: the context view doesn't show pending or due todos --- app/controllers/contexts_controller.rb | 2 +- features/context_list.feature | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/contexts_controller.rb b/app/controllers/contexts_controller.rb index 7d8a14ea..fb2253f7 100644 --- a/app/controllers/contexts_controller.rb +++ b/app/controllers/contexts_controller.rb @@ -277,7 +277,7 @@ class ContextsController < ApplicationController # search manually until I can work out a way to do the same thing using # not_done_todos acts_as_todo_container method Hides actions in hidden # projects from context. - @not_done_todos = @context.todos.active( + @not_done_todos = @context.todos.not_completed( :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", :include => Todo::DEFAULT_INCLUDES) diff --git a/features/context_list.feature b/features/context_list.feature index 140189b0..22f2ac7d 100644 --- a/features/context_list.feature +++ b/features/context_list.feature @@ -27,6 +27,15 @@ Feature: Manage the list of contexts And I follow "@computer" Then I should be on the context page for "@computer" + Scenario: The context view shows all todos + Given I have a todo "foo" in the context "@bar" which is due tomorrow + Given I have a deferred todo "foo2" in the context "@bar" + Given I have a todo "foo3" in the context "@bar" + When I go to the contexts page + And I follow "@bar" + Then I should be on the context page for "@bar" + And the badge should show 3 + @selenium Scenario: Delete context from context page should update badge Given I have a context called "@computer"