( .)
select2 3.x.x. 4.
spec/support/feature/xyz.helper.rb, :
module Feature
module XYZHelper
def select2(value, element_selector)
first("##{element_selector}").find(".select2-choice").click
find(:xpath, "//body").find(".select2-results li", text: value).click
end
end
end
include Feature::XYZHelper. :
select2("Text value here", "Id of selector")