Skip to content

Instantly share code, notes, and snippets.

@bfabry
Created March 4, 2012 07:15
Show Gist options
  • Save bfabry/1971104 to your computer and use it in GitHub Desktop.
Save bfabry/1971104 to your computer and use it in GitHub Desktop.
When /^(?:|I )select "([^"]*)" from "([^"]*)"$/ do |value, field|
combobox = find(:xpath, XPath::HTML.select(field))
options = combobox.all(:xpath, 'option')
display_values = options.map(&:text).map(&:downcase)
sorted_values = display_values.sort
display_values.should == sorted_values
select(value, :from => field)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment