Find all options which are descendants (enables optgroups)

This commit is contained in:
Ingemar Edsborn 2010-06-03 08:55:10 +02:00
parent 08e5ae0c77
commit 979b578fb7
1 changed files with 2 additions and 2 deletions

View File

@ -152,8 +152,8 @@ module Capybara
when :text then postfix += "[text()=#{s(value)}]"
when :checked then postfix += "[@checked]"
when :unchecked then postfix += "[not(@checked)]"
when :options then postfix += value.map { |o| "[./option/text()=#{s(o)}]" }.join
when :selected then postfix += [value].flatten.map { |o| "[./option[@selected]/text()=#{s(o)}]" }.join
when :options then postfix += value.map { |o| "[.//option/text()=#{s(o)}]" }.join
when :selected then postfix += [value].flatten.map { |o| "[.//option[@selected]/text()=#{s(o)}]" }.join
end
postfix
end