Skip to content

Instantly share code, notes, and snippets.

@phinze
Created August 17, 2009 16:12
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 phinze/169215 to your computer and use it in GitHub Desktop.
Save phinze/169215 to your computer and use it in GitHub Desktop.
## Loosen webrat's field label matching regexp
module Webrat
module Locators
class FieldLabeledLocator < Locator
def matching_label_elements_with_numbering
label_elements.select do |label_element|
text(label_element) =~ /^.*#{Regexp.escape(@value.to_s)}.*$/i
end
end
alias_method_chain :matching_label_elements, :numbering
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment