Test for ticket #1043

This commit is contained in:
Eric Allen 2010-07-04 20:13:32 -07:00
parent 04fb281ecd
commit 92047e86e4
2 changed files with 25 additions and 1 deletions

View file

@ -16,4 +16,13 @@ Feature: Manage a project
When I visit the "manage me" project
And I edit the project description to "_successfull outcome_: project is *done*"
Then I should see the italic text "successfull outcome" in the project description
And I should see the bold text "done" in the project description
And I should see the bold text "done" in the project description
# Ticket #1043
@selenium
Scenario: I can move a todo out of the current project
Given I have a project "foo" with 2 todos
When I visit the "foo" project
And I change the project_name field of "Todo 1" to "bar"
Then I should not see the todo "Todo 1"
And I should see the todo "Todo 2"

View file

@ -59,6 +59,13 @@ Then /^I should see ([0-9]+) todos$/ do |count|
end
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)
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)
end
Then /^the dependencies of "(.*)" should include "(.*)"$/ do |child_name, parent_name|
parent = @current_user.todos.find_by_description(parent_name)
parent.should_not be_nil
@ -81,3 +88,11 @@ Then /^I should see "([^\"]*)" within the dependencies of "([^\"]*)"$/ do |succe
xpath = "xpath=//div[@id='line_todo_#{todo.id}']//div[@id='successor_line_todo_#{successor.id}']//span"
selenium.wait_for_element(xpath, :timeout_in_seconds => 5)
end
Then /^I should see the todo "([^\"]*)"$/ do |todo_description|
selenium.is_element_present("//span[.=\"#{todo_description}\"]").should be_true
end
Then /^I should not see the todo "([^\"]*)"$/ do |todo_description|
selenium.is_element_present("//span[.=\"#{todo_description}\"]").should be_false
end