migrate dependencies and admin feature

This commit is contained in:
Reinier Balt 2012-02-03 15:57:23 +01:00
parent c8ab797924
commit d193e21ee0
11 changed files with 70 additions and 117 deletions

View file

@ -44,10 +44,7 @@ Then /^I should see the container for context "([^"]*)"$/ do |context_name|
context.should_not be_nil
xpath = "//div[@id='c#{context.id}']"
wait_for :timeout => 5 do
selenium.is_visible(xpath)
end
page.should have_xpath(xpath)
end
Then /^the container for the context "([^"]*)" should be visible$/ do |context_name|
@ -61,9 +58,7 @@ Then /^I should see "([^"]*)" in the context container for "([^"]*)"$/ do |todo_
todo.should_not be_nil
xpath = "xpath=//div[@id=\"c#{context.id}\"]//div[@id='line_todo_#{todo.id}']"
wait_for :timeout => 5 do
selenium.is_visible(xpath)
end
page.should have_xpath(xpath)
end
Then /^I should not see "([^"]*)" in the context container for "([^"]*)"$/ do |todo_description, context_name|
@ -73,13 +68,7 @@ Then /^I should not see "([^"]*)" in the context container for "([^"]*)"$/ do |t
todo.should_not be_nil
xpath = "xpath=//div[@id=\"c#{context.id}\"]//div[@id='line_todo_#{todo.id}']"
if selenium.is_element_present(xpath)
# give jquery some time to finish
wait_for :timeout_in_seconds => 5 do
!selenium.is_visible(xpath)
end
end
page.should_not have_xpath(xpath)
end
####### Deferred #######
@ -88,22 +77,14 @@ Then /^I should see "([^"]*)" in the deferred container$/ do |todo_description|
todo = @current_user.todos.find_by_description(todo_description)
todo.should_not be_nil
xpath = "//div[@id='tickler']//div[@id='line_todo_#{todo.id}']"
wait_for :timeout => 5 do
selenium.is_element_present(xpath)
end
page.should have_xpath("//div[@id='tickler']//div[@id='line_todo_#{todo.id}']")
end
Then /^I should not see "([^"]*)" in the deferred container$/ do |todo_description|
todo = @current_user.todos.find_by_description(todo_description)
todo.should_not be_nil
xpath = "//div[@id='tickler']//div[@id='line_todo_#{todo.id}']"
wait_for :timeout => 5 do
!selenium.is_element_present(xpath)
end
page.should_not have_xpath("//div[@id='tickler']//div[@id='line_todo_#{todo.id}']")
end
####### Project #######
@ -113,10 +94,7 @@ Then /^I should see "([^"]*)" in the action container$/ do |todo_description|
todo.should_not be_nil
xpath = "//div[@id='p#{todo.project.id}items']//div[@id='line_todo_#{todo.id}']"
wait_for :timeout => 5 do
selenium.is_element_present(xpath)
end
page.should have_xpath(xpath)
end
Then /^I should not see "([^"]*)" in the project container of "([^"]*)"$/ do |todo_description, project_name|
@ -127,12 +105,7 @@ Then /^I should not see "([^"]*)" in the project container of "([^"]*)"$/ do |to
project.should_not be_nil
xpath = "//div[@id='p#{todo.project.id}items']//div[@id='line_todo_#{todo.id}']"
if selenium.is_element_present(xpath)
wait_for :timeout => 5 do
!selenium.is_element_present(xpath)
end
end
page.should_not have_xpath(xpath)
end
Then /^I should see "([^"]*)" in project container for "([^"]*)"$/ do |todo_description, project_name|
@ -143,9 +116,7 @@ Then /^I should see "([^"]*)" in project container for "([^"]*)"$/ do |todo_desc
project.should_not be_nil
xpath = "//div[@id='p#{project.id}items']//div[@id='line_todo_#{todo.id}']"
selenium.wait_for_element("xpath=#{xpath}", :timeout_in_seconds => 5)
selenium.is_visible(xpath).should be_true
page.should have_xpath(xpath)
end
####### Completed #######
@ -155,10 +126,7 @@ Then /^I should see "([^"]*)" in the completed container$/ do |todo_description|
todo.should_not be_nil
xpath = "//div[@id='completed_container']//div[@id='line_todo_#{todo.id}']"
wait_for :timeout => 5 do
selenium.is_element_present(xpath)
end
page.should have_xpath(xpath)
end
Then /^I should not see "([^"]*)" in the completed container$/ do |todo_description|
@ -166,12 +134,7 @@ Then /^I should not see "([^"]*)" in the completed container$/ do |todo_descript
todo.should_not be_nil
xpath = "//div[@id='completed_container']//div[@id='line_todo_#{todo.id}']"
if selenium.is_element_present(xpath)
wait_for :timeout => 5 do
!selenium.is_element_present(xpath)
end
end
page.should_not have_xpath(xpath)
end
####### Hidden #######
@ -181,10 +144,7 @@ Then /^I should see "([^"]*)" in the hidden container$/ do |todo_description|
todo.should_not be_nil
xpath = "//div[@id='hidden']//div[@id='line_todo_#{todo.id}']"
wait_for :timeout => 5 do
selenium.is_element_present(xpath)
end
page.should have_xpath(xpath)
end
####### Calendar #######
@ -194,7 +154,7 @@ Then /^I should see "([^"]*)" in the due next month container$/ do |todo_descrip
todo.should_not be_nil
within "div#due_after_this_month" do
find("div#line_todo_#{todo.id}").should_not be_nil
page.should have_css("div#line_todo_#{todo.id}")
end
end