diff options
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/select2_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/support/select2_helper.rb b/spec/support/select2_helper.rb index 691f84f39d4..04d25b5e9e9 100644 --- a/spec/support/select2_helper.rb +++ b/spec/support/select2_helper.rb @@ -12,9 +12,9 @@ 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) + raise ArgumentError, 'options must be a Hash' unless options.kind_of?(Hash) - selector = options[:from] + selector = options.fetch(:from) if options[:multiple] execute_script("$('#{selector}').select2('val', ['#{value}'], true);") |