start fiingx failing cucumber scenario's and some small fixes

new capybara introduces some failing scenario's
This commit is contained in:
Reinier Balt 2012-12-23 23:16:22 +01:00
parent c8d2db6fc3
commit da2bee2e53
10 changed files with 42 additions and 19 deletions

View file

@ -86,7 +86,9 @@ When /^I edit the description of "([^"]*)" to "([^"]*)"$/ do |action_description
todo.should_not be_nil
open_edit_form_for(todo)
fill_in "todo_description", :with => new_description
within "form.edit_todo_form" do
fill_in "todo_description", :with => new_description
end
submit_edit_todo_form(todo)
end

View file

@ -1,5 +1,26 @@
module TracksStepHelper
def wait_until(timeout = 5)
timeout(timeout) { yield }
end
def timeout(seconds = 1, error_message = nil, &block)
start_time = Time.now
result = nil
until result
return result if result = yield
delay = seconds - (Time.now - start_time)
if delay <= 0
raise TimeoutError, error_message || "timed out"
end
sleep(0.05)
end
end
def open_edit_form_for(todo)
within "div#line_todo_#{todo.id}" do
find("a#icon_edit_todo_#{todo.id}").click

View file

@ -1,7 +1,7 @@
Feature: Show done
In order to see what I have completed
As an user
I want see my done todos
I want to see my done todos
Background:
Given the following user record