Skip to content

Instantly share code, notes, and snippets.

@mikel
Created June 8, 2011 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikel/1013603 to your computer and use it in GitHub Desktop.
Save mikel/1013603 to your computer and use it in GitHub Desktop.
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