-
-
Save strukturedkaos/3801641 to your computer and use it in GitHub Desktop.
Select2.js capybara
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A much simpler, cleaner version: