Method: Spree::TestingSupport::CapybaraExt#select2

Defined in:
lib/spree/testing_support/capybara_ext.rb

#select2(value, options) ⇒ Object



71
72
73
74
75
76
77
78
# File 'lib/spree/testing_support/capybara_ext.rb', line 71

def select2(value, options)
  label = find_label_by_text(options[:from])

  within label.first(:xpath, ".//..") do
    options[:from] = "##{find('.select2-container')['id']}"
  end
  targetted_select2(value, options)
end