goodwill/capybara-select2 — pull request #28 by jayschab (2014-07-11 19:07:34+00:00)
Title: Add support for lists with `<optgroup>`'s

When translating a list with ``'s select2 will use the
following structue:
````
div.select2-drop
ul.select2-results
li.select2-result.select2-result-unselectable
div
ul.select2-result-stub
li.select2-result.select2-result-selectable
li.select2-result.select2-result-selectable
...
li.select2-result.select2-result-unselectable
...
````
The old `"#{drop_container} li"` selector would lead to
`Capybara::Ambiguous` error complaining that:

Ambiguous match, found 2 elements matching css ".select2-drop li" with
text "..."

because of the additional `
` at the optgroup level.

This change adds a selector for `"select2-result-selectable"` to
ignore such headers.