lib/kelp/dropdown.rb
# Verify that a dropdown currently has the option with the given `value`
# attribute selected. Note that this differs from {#dropdown_should_equal},
# in that it looks at the actual `value` attribute of the selected option,
# rather than its visible contents.
#
# @param [String] dropdown
#   Capybara locator for the dropdown (the `select` element)
# @param [String] value
#   Expected `value` attribute of the selected `option`
#
# @raise [Kelp::Unexpected]
#   If the given dropdown's 'value' attribute is not equal to `value`
#
Verify that a dropdown currently has the option with the given `value`
attribute selected. Note that this differs from {#dropdown_should_equal},
in that it looks at the actual `value` attribute of the selected option,
rather than its visible contents.
Verify that a dropdown currently has the option with the given ` value ` attribute selected . Note that this differs from { #dropdown_should_equal } in that it looks at the actual ` value ` attribute of the selected option rather than its visible contents .
def dropdown_value_should_equal(dropdown, value)
      field = find_field(dropdown)
      if field.value != value
        raise Kelp::Unexpected,
          "Expected '#{dropdown}' dropdown's value to equal '#{value}'" + \
          "\nGot '#{field.value}' instead"
      end
    end
def dropdown_value_should_equal ( dropdown , value ) field = find_field ( dropdown ) if field . value != value raise Kelp :: Unexpected , "Expected '#{dropdown}' dropdown's value to equal '#{value}'" + "\nGot '#{field.value}' instead" end end
Verify that a dropdown currently has the option with the given `value`
attribute selected.
Verify that a dropdown currently has the option with the given ` value ` attribute selected .
[Kelp::Unexpected] If the given dropdown's 'value' attribute is not equal to `value`
[ Kelp :: Unexpected ] If the given dropdown ' s ' value ' attribute is not equal to ` value `
dropdown
<not_specific>
value
<not_specific>
<not_specific>
value Expected `value` attribute of the selected `option`
value Expected ` value ` attribute of the selected ` option `