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

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

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