From bd7419a59295a6ee16b8395d65fb9078eb863160 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Thu, 18 Aug 2011 09:38:48 +0200 Subject: [PATCH] fix failing tests --- features/calendar.feature | 2 +- features/show_statistics.feature | 2 +- features/step_definitions/todo_edit_steps.rb | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/features/calendar.feature b/features/calendar.feature index dee7cecc..db7e6ccb 100644 --- a/features/calendar.feature +++ b/features/calendar.feature @@ -41,7 +41,7 @@ Feature: Show all due actions in a calendar view Then I should not see "a new next action" @selenium - Scenario: Deleting a todo complete will remove it from the calendar + Scenario: Deleting a todo will remove it from the calendar Given I have a todo "a new next action" in the context "@calendar" which is due tomorrow When I go to the calendar page Then I should see "a new next action" diff --git a/features/show_statistics.feature b/features/show_statistics.feature index 228e4855..fb8a3951 100644 --- a/features/show_statistics.feature +++ b/features/show_statistics.feature @@ -70,7 +70,7 @@ Feature: Show statistics Then I should not see the todo "todo 1" And I should see the todo "foo bar" - @selenium @wip + @selenium Scenario: Marking a todo selected from a chart as complete will remove it from the page Given I have 5 todos When I go to the statistics page diff --git a/features/step_definitions/todo_edit_steps.rb b/features/step_definitions/todo_edit_steps.rb index 88d5cfdc..be661655 100644 --- a/features/step_definitions/todo_edit_steps.rb +++ b/features/step_definitions/todo_edit_steps.rb @@ -119,18 +119,19 @@ end When /^I edit the due date of "([^"]*)" to "([^"]*)"$/ do |action_description, date| todo = @current_user.todos.find_by_description(action_description) todo.should_not be_nil + open_edit_form_for(todo) fill_in "due_todo_#{todo.id}", :with => date submit_edit_todo_form(todo) end When /^I edit the due date of "([^"]*)" to tomorrow$/ do |action_description| - date = format_date(todo.created_at + 1.day) + date = format_date(Time.zone.now + 1.day) When "I edit the due date of \"#{action_description}\" to \"#{date}\"" end When /^I edit the due date of "([^"]*)" to next month$/ do |action_description| - date = format_date(todo.created_at + 1.month) + date = format_date(Time.zone.now + 1.month) When "I edit the due date of \"#{action_description}\" to \"#{date}\"" end