Skip to content

Instantly share code, notes, and snippets.

@jkassemi
Created September 27, 2012 23:09
Show Gist options
  • Save jkassemi/3797001 to your computer and use it in GitHub Desktop.
Save jkassemi/3797001 to your computer and use it in GitHub Desktop.
Select2.js capybara
def select2_select(text, options)
page.find("#s2id_#{options[:from]} a").click
page.all("ul.select2-results li").each do |e|
if e.text == text
e.click
return
end
end
end
@brobertsaz
Copy link

How do you call this from within the rspec test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment