Extract with into option

This commit is contained in:
Jonas Nicklas 2012-01-02 17:27:26 +01:00
parent dd7123f0b0
commit c0bc3f4f6b
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,6 @@ module Capybara
def filter(node)
return false if options[:text] and not node.text.match(options[:text])
return false if options[:visible] and not node.visible?
return false if options[:with] and not node.value == options[:with]
selector.custom_filters.each do |name, block|
return false if options.has_key?(name) and not block.call(node, options[name])
end
@ -115,6 +114,7 @@ Capybara.add_selector(:field) do
xpath { |locator| XPath::HTML.field(locator) }
filter(:checked) { |node, value| not(value ^ node.checked?) }
filter(:unchecked) { |node, value| (value ^ node.checked?) }
filter(:with) { |node, with| node.value == with }
end
Capybara.add_selector(:fieldset) do