Capybara integration tests with jquery.selectize
How can I write a capybara integration test with a form using jquery.selectize ? I'd like to test a user entering a couple of values. I created a helper that I mix in to my capybara feature specs: module PageSteps def fill_in_selectized(key, *values) values.flatten.each do |value| page.execute_script(%{ $('.#{key} .selectize-input input').val('#{value}'); $('##{key}').selectize()[0].selectize.createItem(); }) end end end And here's an example of how it is used: # Single value fill_in_selectized('candidate_offices', 'Santa Monica') # Multiple values fill_in_selectized('candidate_offices', ['San