1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Merge remote branch 'darrenhinderer/master'

This commit is contained in:
Jonas Nicklas 2010-07-09 10:05:43 +02:00
commit c5e541b63d

View file

@ -33,8 +33,14 @@ module Capybara
results = all_unfiltered(locator)
if options[:text]
options[:text] = Regexp.escape(options[:text]) unless options[:text].kind_of?(Regexp)
results = results.select { |n| n.text.match(options[:text]) }
if options[:text].kind_of?(Regexp)
regexp = options[:text]
else
regexp = Regexp.escape(options[:text])
end
results = results.select { |n| n.text.match(regexp) }
end
if options[:visible] or Capybara.ignore_hidden_elements