Update and add scenario's for testing interaction with new deferred container on context page and fix regressions

This commit is contained in:
Reinier Balt 2012-03-23 20:39:04 +01:00
parent dd957f0feb
commit 7435b1ba93
14 changed files with 161 additions and 112 deletions

View file

@ -82,16 +82,22 @@ Then /^I should not see "([^"]*)" in the deferred container$/ do |todo_descripti
page.should_not have_xpath("//div[@id='tickler']//div[@id='line_todo_#{todo.id}']")
end
####### Project #######
Then /^I should see "([^"]*)" in the action container$/ do |todo_description|
Then /^I should (not see|see) "([^"]*)" in the action container$/ do |visible, todo_description|
todo = @current_user.todos.find_by_description(todo_description)
todo.should_not be_nil
xpath = "//div[@id='p#{todo.project.id}items']//div[@id='line_todo_#{todo.id}']"
page.should have_xpath(xpath)
id = @source_view=="project" ? "p#{todo.project_id}items" : "c#{todo.context_id}items"
xpath = "//div[@id='#{id}']//div[@id='line_todo_#{todo.id}']"
page.send(visible=="see" ? :should : :should_not, have_xpath(xpath))
end
Then /^I should not see "([^"]*)" in the context container of "([^"]*)"$/ do |todo_description, context_name|
step "I should not see \"#{todo_description}\" in the action container"
end
####### Project #######
Then /^I should not see "([^"]*)" in the project container of "([^"]*)"$/ do |todo_description, project_name|
todo = @current_user.todos.find_by_description(todo_description)
todo.should_not be_nil