Skip to content

Instantly share code, notes, and snippets.

View ddonahue99's full-sized avatar

Dave Donahue ddonahue99

  • AllTrails
  • Seattle, WA
View GitHub Profile
@ddonahue99
ddonahue99 / token_input_helpers.rb
Last active December 20, 2015 10:31 — forked from jtanium/token_input_helpers.rb
jquery.tokeninput.js cucumber helper, updated with capybara 2.1 and theme support
module TokenInputHelpers
THEME = '' # set to 'facebook' or 'mac' if using themes
def token_input(locator, options)
raise "Must pass a hash containing 'with'" unless options.is_a?(Hash) && options.has_key?(:with)
theme = THEME.present? ? "-#{THEME}" : ""
field = _find_fillable_field(locator) # find the field that will ultimately be sent to the server, the one the user intends to fill in