Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
When /^I click on the "([^"]*)" question$/ do |title|
question = Question.find_by_title(title)
all(:css, "form#edit_question_#{question.id} thead").each { |node| node.click }
end
When /^I press enter in the "([^"]*)" field$/ do |name|
page.execute_script(%Q{
var e = jQuery.Event('keypress');
e.keyCode = 13;
$("##{name}").trigger(e);
})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment