mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-06 07:51:48 +01:00
get all scenario's running again, first pass.
This commit is contained in:
parent
ede898120c
commit
0a9755c8a3
27 changed files with 90 additions and 90 deletions
|
|
@ -72,21 +72,21 @@ Then /^I should see "([^"]*)" in the deferred container$/ do |todo_description|
|
|||
todo = @current_user.todos.where(:description => todo_description).first
|
||||
todo.should_not be_nil
|
||||
|
||||
page.should have_xpath("//div[@id='tickler']//div[@id='line_todo_#{todo.id}']")
|
||||
page.should have_xpath("//div[@id='deferred_pending_container']//div[@id='line_todo_#{todo.id}']")
|
||||
end
|
||||
|
||||
Then /^I should not see "([^"]*)" in the deferred container$/ do |todo_description|
|
||||
todo = @current_user.todos.where(:description => todo_description).first
|
||||
todo.should_not be_nil
|
||||
|
||||
page.should_not have_xpath("//div[@id='tickler']//div[@id='line_todo_#{todo.id}']")
|
||||
page.should_not have_xpath("//div[@id='deferred_pending_container']//div[@id='line_todo_#{todo.id}']")
|
||||
end
|
||||
|
||||
Then /^I should (not see|see) "([^"]*)" in the action container$/ do |visible, todo_description|
|
||||
todo = @current_user.todos.where(:description => todo_description).first
|
||||
todo.should_not be_nil
|
||||
|
||||
id = @source_view=="project" ? "p#{todo.project_id}items" : "c#{todo.context_id}items"
|
||||
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))
|
||||
|
|
@ -105,7 +105,7 @@ Then /^I should not see "([^"]*)" in the project container of "([^"]*)"$/ do |to
|
|||
project = @current_user.projects.where(:name => project_name).first
|
||||
project.should_not be_nil
|
||||
|
||||
xpath = "//div[@id='p#{todo.project.id}items']//div[@id='line_todo_#{todo.id}']"
|
||||
xpath = "//div[@id='p#{todo.project.id}_items']//div[@id='line_todo_#{todo.id}']"
|
||||
page.should_not have_xpath(xpath)
|
||||
end
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ Then /^I should see "([^"]*)" in project container for "([^"]*)"$/ do |todo_desc
|
|||
project = @current_user.projects.where(:name => project_name).first
|
||||
project.should_not be_nil
|
||||
|
||||
xpath = "//div[@id='p#{project.id}items']//div[@id='line_todo_#{todo.id}']"
|
||||
xpath = "//div[@id='p#{project.id}_items']//div[@id='line_todo_#{todo.id}']"
|
||||
page.should have_xpath(xpath)
|
||||
end
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ Then /^I should see "([^"]*)" in the hidden container$/ do |todo_description|
|
|||
todo = @current_user.todos.where(:description => todo_description).first
|
||||
todo.should_not be_nil
|
||||
|
||||
xpath = "//div[@id='hidden']//div[@id='line_todo_#{todo.id}']"
|
||||
xpath = "//div[@id='hidden_container']//div[@id='line_todo_#{todo.id}']"
|
||||
page.should have_xpath(xpath)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -74,9 +74,9 @@ end
|
|||
|
||||
Then /^I should (see|not see) empty message for (todo|completed todo|deferred todo)s of context/ do |visible, state|
|
||||
css = "error"
|
||||
css = "div#c#{@context.id}empty-nd" if state == "todo"
|
||||
css = "div#empty-d" if state == "completed todo"
|
||||
css = "div#tickler-empty-nd" if state == "deferred todo"
|
||||
css = "div#c#{@context.id}-empty-d" if state == "todo"
|
||||
css = "div#completed_container-empty-d" if state == "completed todo"
|
||||
css = "div#deferred_pending_container-empty-d" if state == "deferred todo"
|
||||
|
||||
page.send(visible=="see" ? :should : :should_not, have_css(css, :visible=>true))
|
||||
end
|
||||
|
|
@ -158,13 +158,13 @@ When /^I try to edit the project name of "([^"]*)" to "([^"]*)"$/ do |project_cu
|
|||
end
|
||||
|
||||
When /^I edit the project name in place to be "([^"]*)"$/ do |new_project_name|
|
||||
page.find("div#project_name").click
|
||||
page.find("span#project_name").click
|
||||
fill_in "value", :with => new_project_name
|
||||
click_button "Ok"
|
||||
end
|
||||
|
||||
When /^I click to edit the project name in place$/ do
|
||||
page.find("div#project_name").click
|
||||
page.find("span#project_name").click
|
||||
end
|
||||
|
||||
When /^I edit the project settings$/ do
|
||||
|
|
@ -236,13 +236,13 @@ end
|
|||
|
||||
Then /^I should (see|not see) empty message for (todos|deferred todos|completed todos) of project/ do |visible, state|
|
||||
css = "wrong state"
|
||||
css = "div#p#{@project.id}empty-nd" if state == "todos"
|
||||
css = "div#tickler-empty-nd" if state == "deferred todos"
|
||||
css = "div#empty-d" if state == "completed todos"
|
||||
css = "div#p#{@project.id}-empty-d" if state == "todos"
|
||||
css = "div#deferred_pending_container-empty-d" if state == "deferred todos"
|
||||
css = "div#completed_container-empty-d" if state == "completed todos"
|
||||
|
||||
elem = find(css)
|
||||
elem.should_not be_nil
|
||||
elem.send(visible=="see" ? "should" : "should_not", be_visible)
|
||||
elem.send(visible=="see" ? :should : :should_not, be_visible)
|
||||
end
|
||||
|
||||
Then /^I edit the default tags to "([^"]*)"$/ do |default_tags|
|
||||
|
|
@ -253,14 +253,14 @@ end
|
|||
|
||||
Then /^I should be able to change the project name in place$/ do
|
||||
# Note that this is not changing the project name
|
||||
page.should have_css("div#project_name>form>input")
|
||||
page.find("div#project_name > form > button[type=cancel]").click
|
||||
page.should_not have_css("div#project_name>form>input")
|
||||
page.should have_css("span#project_name>form>input")
|
||||
page.find("span#project_name > form > button[type=cancel]").click
|
||||
page.should_not have_css("span#project_name>form>input")
|
||||
end
|
||||
|
||||
Then /^I should not be able to change the project name in place$/ do
|
||||
step "I click to edit the project name in place"
|
||||
page.should_not have_xpath("//div[@id='project_name']/form/input")
|
||||
page.should_not have_xpath("//span[@id='project_name']/form/input")
|
||||
end
|
||||
|
||||
Then /^the form for adding a note should not be visible$/ do
|
||||
|
|
@ -295,7 +295,7 @@ end
|
|||
|
||||
Then /^the project title should be "(.*)"$/ do |title|
|
||||
wait_until do
|
||||
page.find("h2#project_name_container div#project_name").text == title
|
||||
page.find("h2#project_name_container span#project_name").text == title
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -153,12 +153,12 @@ Then /^I should see "([^"]*)" in the completed section of the mobile site$/ do |
|
|||
end
|
||||
|
||||
Then /^I should (see|not see) empty message for (completed todos|todos) of home/ do |visible, kind_of_todo|
|
||||
elem = find(kind_of_todo=="todos" ? "div#no_todos_in_view" : "div#empty-d")
|
||||
elem = find(kind_of_todo=="todos" ? "div#no_todos_in_view" : "div#completed_container-empty-d")
|
||||
elem.send(visible=="see" ? "should" : "should_not", be_visible)
|
||||
end
|
||||
|
||||
Then /^I should (see|not see) the empty tickler message$/ do |see|
|
||||
elem = find("div#tickler-empty-nd")
|
||||
elem = find("div#no_todos_in_view")
|
||||
elem.send(see=="see" ? "should" : "should_not", be_visible)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@ Then /^I should see empty message for todos of tag$/ do
|
|||
end
|
||||
|
||||
Then /^I should not see empty message for completed todos of tag$/ do
|
||||
page.should_not have_css("div#empty-d", :visible=>true)
|
||||
page.should_not have_css("div#completed_container-empty-d", :visible=>true)
|
||||
end
|
||||
|
||||
Then /^I should see empty message for completed todos of tag$/ do
|
||||
page.should have_css("div#empty-d", :visible=>true)
|
||||
page.should have_css("div#completed_container-empty-d", :visible=>true)
|
||||
end
|
||||
|
||||
Then /^I should not see empty message for deferred todos of tag$/ do
|
||||
page.should_not have_css("div#tickler-empty-nd", :visible=>true)
|
||||
page.should_not have_css("div#deferred_pending_container-empty-d", :visible=>true)
|
||||
end
|
||||
|
||||
Then /^I should see empty message for deferred todos of tag$/ do
|
||||
page.should have_css("div#tickler-empty-nd", :visible=>true)
|
||||
page.should have_css("div#deferred_pending_container-empty-d", :visible=>true)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue