diff --git a/lib/webrat/core/elements/select_option.rb b/lib/webrat/core/elements/select_option.rb index 8e19e4f..a586a77 100644 --- a/lib/webrat/core/elements/select_option.rb +++ b/lib/webrat/core/elements/select_option.rb @@ -17,6 +17,10 @@ module Webrat select.unset(value) end + def inner_text + @element.inner_text + end + protected def select diff --git a/lib/webrat/core/locators/select_option_locator.rb b/lib/webrat/core/locators/select_option_locator.rb index 10f509b..49df2b0 100644 --- a/lib/webrat/core/locators/select_option_locator.rb +++ b/lib/webrat/core/locators/select_option_locator.rb @@ -21,7 +21,7 @@ module Webrat if @option_text.is_a?(Regexp) o.element.inner_html =~ @option_text else - escaped_or_non_escaped_values.include?(o.element.inner_html) + o.inner_text == @option_text.to_s end end else @@ -29,7 +29,7 @@ module Webrat if @option_text.is_a?(Regexp) o.inner_html =~ @option_text else - escaped_or_non_escaped_values.include?(o.inner_html) + o.inner_text == @option_text.to_s end end @@ -37,10 +37,6 @@ module Webrat end end - def escaped_or_non_escaped_values - [@option_text.to_s, CGI.escapeHTML(@option_text.to_s)] - end - def option_elements @dom.xpath(*SelectOption.xpath_search) end