summaryrefslogtreecommitdiff
path: root/spec/support/helpers/select2_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/select2_helper.rb')
-rw-r--r--spec/support/helpers/select2_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/support/helpers/select2_helper.rb b/spec/support/helpers/select2_helper.rb
index 90618ba5b19..100e62489ab 100644
--- a/spec/support/helpers/select2_helper.rb
+++ b/spec/support/helpers/select2_helper.rb
@@ -11,9 +11,13 @@
#
module Select2Helper
+ include WaitForRequests
+
def select2(value, options = {})
raise ArgumentError, 'options must be a Hash' unless options.is_a?(Hash)
+ wait_for_requests unless options[:async]
+
selector = options.fetch(:from)
first(selector, visible: false)