add done views to projects and recurring todos

This commit is contained in:
Reinier Balt 2011-06-20 06:50:25 +02:00
parent 5496b84642
commit 35f947ec57
13 changed files with 166 additions and 20 deletions

View file

@ -37,6 +37,19 @@ Given /^I have the following projects:$/ do |table|
end
end
Given /^I have a completed project called "([^"]*)"$/ do |project_name|
Given "I have a project called \"#{project_name}\""
@project.complete!
@project.reload
assert @project.completed?
end
Given /^I have (\d+) completed projects$/ do |number_of_projects|
1.upto number_of_projects.to_i do |i|
Given "I have a completed project called \"Project #{i}\""
end
end
Given /^I have no projects$/ do
Project.delete_all
end

View file

@ -26,6 +26,12 @@ Given /^I have a completed repeat pattern "([^"]*)"$/ do |pattern_name|
@recurring_todo.completed?.should be_true
end
Given /^I have (\d+) completed repeat patterns$/ do |number_of_patterns|
1.upto number_of_patterns.to_i do |i|
Given "I have a completed repeat pattern \"Repeating Todo #{i}\""
end
end
When /^I select "([^\"]*)" recurrence pattern$/ do |recurrence_period|
selenium.click("recurring_todo_recurring_period_#{recurrence_period.downcase}")
end

View file

@ -68,7 +68,8 @@ Given /^I have ([0-9]+) completed todos in context "([^"]*)"$/ do |count, contex
end
Given /^I have ([0-9]+) completed todos$/ do |count|
Given "I have #{count} completed todos in the context \"context D\""
Given "I have a context called \"context D\""
Given "I have #{count} completed todos in context \"context D\""
end
Given /^I have ([0-9]+) completed todos with a note$/ do |count|