-
-
Save eprothro/7456345 to your computer and use it in GitHub Desktop.
This file contains 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(option, opts={}) | |
# same as foundation_select, but for select2 | |
# boxes used throughout the staff app. | |
originating_select_name = opts[:from] | |
originating_select_id = find("select[name='#{originating_select_name}']")['id'] | |
custom_select = find(".select2-container[id$='#{originating_select_id}']") | |
# click dropdown | |
custom_select.find("a.select2-choice").click | |
# click option with correct text | |
find("ul.select2-results").find('li', text: option).click | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment