mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-13 02:44:22 +01:00
cucumber tests for the review mode
This commit is contained in:
parent
8f5c04522e
commit
d14a2a808d
4 changed files with 63 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
9
features/step_definitions/review_steps.rb
Normal file
9
features/step_definitions/review_steps.rb
Normal 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
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue