cucumber tests for the review mode

This commit is contained in:
Sebastian Fischmeister 2012-01-30 09:56:58 -05:00
parent 8f5c04522e
commit d14a2a808d
4 changed files with 63 additions and 1 deletions

View file

@ -1,3 +1,10 @@
Given /^I have an outdated project "([^"]*)" with (\d+) todos$/ do |project_name, num_todos|
Given "I have a project \"#{project_name}\" with #{num_todos} todos"
@project = @current_user.projects.find_by_name(project_name)
@project.last_reviewed = @current_user.time - @current_user.prefs.review_period.days-1
@project.save
end
Given /^I have a project "([^\"]*)" with ([0-9]+) todos$/ do |project_name, num_todos|
@context = @current_user.contexts.find_or_create_by_name("Context A")
@project = @current_user.projects.create!(:name => project_name)

View file

@ -0,0 +1,9 @@
Then /^I see the project "([^"]*)" in the "([^"]*)" list$/ do |name, state|
project = @current_user.projects.find_by_name(name)
project.should_not be_nil
xpath = "//div[@id='list-#{state}-projects']//div[@id='project_#{project.id}']"
response.should have_xpath(xpath)
end