Skip to content

Instantly share code, notes, and snippets.

@antonio
Forked from sirbrillig/select2_helper.rb
Last active December 21, 2015 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save antonio/6307547 to your computer and use it in GitHub Desktop.
Save antonio/6307547 to your computer and use it in GitHub Desktop.
def fill_in_select2(selector, options={})
container = "#s2id_#{selector}"
page.find("#{container} a").click
page.find(".select2-search input.select2-input").set options[:with]
page.first(".select2-match").click
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment