Rename JS file so that it is loaded after the spree code it is overriding. Admin can't add products outside distribution to an order.

This commit is contained in:
Rohan Mitchell
2014-07-16 11:26:22 +10:00
parent 6dfd26ac69
commit 75a59eb5cc
3 changed files with 37 additions and 1 deletions

View File

@@ -129,6 +129,15 @@ module WebHelper
targetted_select2(value, options)
end
def have_select2_option(value, options)
container = options[:dropdown_css] || ".select2-with-searchbox"
page.execute_script %Q{$('#{options[:from]}').select2('open')}
page.execute_script "$('#{container} input.select2-input').val('#{value}').trigger('keyup-change');"
sleep 1
have_selector "div.select2-result-label", text: value
end
private
def wait_for_ajax
wait_until { page.evaluate_script("$.active") == 0 }