add test for last commit

fix merge error
This commit is contained in:
Reinier Balt 2011-03-09 12:27:47 +01:00
parent 90d3211a4d
commit 5fdc5ae436
2 changed files with 5 additions and 9 deletions

View file

@ -101,7 +101,8 @@ Feature: Edit a project
@selenium @wip
Scenario: I can move a todo out of the current project
Given I have a project "foo" with 2 todos
And I have a project called "bar"
When I go to 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"
Then I should not see "Todo 1"
And I should see "Todo 2"

View file

@ -61,18 +61,13 @@ Given /^I have a project "([^"]*)" that has the following todos$/ do |project_na
end
end
When /I change the (.*) field of "([^\"]*)" to "([^\"]*)"$/ do |field, todo_name, new_value|
When /I change the (.*) field of "([^\"]*)" to "([^\"]*)"$/ do |field_name, todo_name, new_value|
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)
open_edit_form_for(todo)
selenium.type("css=form.edit_todo_form input[name=#{field}]", new_value)
#selenium.click("css=button.positive", :wait_for => :ajax, :javascript_framework => :jquery)
selenium.type("css=form.edit_todo_form input[name=#{field_name}]", new_value)
submit_edit_todo_form(todo)
# TODO: change to a wait_for
sleep(1)
end
When /^I submit a new action with description "([^"]*)"$/ do |description|