Created
October 3, 2014 14:50
-
-
Save hugomaiavieira/2ab60400e58d88fbf0b4 to your computer and use it in GitHub Desktop.
select2
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 insert_select2(team_name = nil) | |
| # When it simulates an existing record, id is passed, and controller take it by id. | |
| # It's simulating Select2 request for getting record on the query. | |
| # When name is passed, it indicates that no record was found, creating a new one. | |
| # This behavior is implemented on SalespointController#create. | |
| execute_script("$('#app-team-modal .select2-focusser').val('#{team_name}').trigger('keyup')"); | |
| find('.select2-chosen').click | |
| sleep 2 | |
| find('.select2-results li:first-child').click | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment