Skip to content

Instantly share code, notes, and snippets.

@phinze
Created Aug 17, 2009
Embed
What would you like to do?
## 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