How to test a Select2 element with capybara DSL?
问题 I have a Select2 element on a page that loads results via ajax. Would like to test this with capybara/rspec (using the poltergeist driver), but since the Select2 element actually starts out as a hidden field, and then populates a <ul> once results are processed, none of the normal select , fill_in or choose helpers will work. What I have now is something like it "should have a search field for events" do click_link "Select an Event" # this works as expected within('.select2-container') do #