diff options
Diffstat (limited to 'spec/support/select2_helper.rb')
-rw-r--r-- | spec/support/select2_helper.rb | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/spec/support/select2_helper.rb b/spec/support/select2_helper.rb deleted file mode 100644 index 691f84f39d4..00000000000 --- a/spec/support/select2_helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# Select2 ajax programmatic helper -# It allows you to select value from select2 -# -# Params -# value - real value of selected item -# opts - options containing css selector -# -# Usage: -# -# select2(2, from: '#user_ids') -# - -module Select2Helper - def select2(value, options={}) - raise "Must pass a hash containing 'from'" if not options.is_a?(Hash) or not options.has_key?(:from) - - selector = options[:from] - - if options[:multiple] - execute_script("$('#{selector}').select2('val', ['#{value}'], true);") - else - execute_script("$('#{selector}').select2('val', '#{value}', true);") - end - end -end |