upgrade last of the project functions

This commit is contained in:
Reinier Balt 2010-10-22 11:55:54 +02:00
parent 2c47b27a87
commit d7a780ef0c
8 changed files with 20 additions and 18 deletions

View file

@ -1,5 +1,4 @@
When /^I delete project "([^"]*)"$/ do |project_name|
# from the project list page
project = @current_user.projects.find_by_name(project_name)
project.should_not be_nil
click_link "delete_project_#{project.id}"
@ -38,10 +37,10 @@ When /^I submit a new project with name "([^"]*)" and select take me to the proj
selenium.wait_for_page_to_load(5000) # follow the redirect
end
When /^I sort the list alphabetically$/ do
When /^I sort the active list alphabetically$/ do
click_link "Alphabetically"
selenium.wait_for :wait_for => :ajax, :javascript_framework => :jquery
selenium.get_confirmation.should == "Are you sure that you want to sort these projects alphabetically? This will replace the existing sort order."
end
When /^I sort the list by number of tasks$/ do

View file

@ -1,5 +1,5 @@
Given /^I have a project "([^\"]*)" with (.*) todos$/ do |project_name, num_todos|
context = @current_user.contexts.create!(:name => "Context A")
context = @current_user.contexts.find_or_create_by_name("Context A")
project = @current_user.projects.create!(:name => project_name)
1.upto num_todos.to_i do |i|
@current_user.todos.create!(

View file

@ -73,7 +73,10 @@ Then /^I should see ([0-9]+) todos$/ do |count|
end
When /I change the (.*) field of "([^\"]*)" to "([^\"]*)"$/ do |field, todo_name, new_value|
selenium.click("//span[@class=\"todo.descr\"][.=\"#{todo_name}\"]/../../a[@class=\"icon edit_item\"]", :wait_for => :ajax, :javascript_framework => :jquery)
todo = @current_user.todos.find_by_description(todo_name)
todo.should_not be_nil
selenium.click("//img[@id='edit_icon_todo_#{todo.id}']", :wait_for => :ajax, :javascript_framework => :jquery)
selenium.type("css=form.edit_todo_form input[name=#{field}]", new_value)
selenium.click("css=button.positive", :wait_for => :ajax, :javascript_framework => :jquery)
sleep(5)