mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Removed deprecated spec helper have_select2_option and fixed its last usage
This commit is contained in:
@@ -128,7 +128,7 @@ feature %q{
|
||||
visit '/admin/orders'
|
||||
page.find('td.actions a.icon-edit').click
|
||||
|
||||
expect(page).not_to have_select2_option product.name, from: ".variant_autocomplete", dropdown_css: ".select2-search"
|
||||
expect(page).not_to have_select2 "add_variant_id", with_options: [product.name]
|
||||
end
|
||||
|
||||
scenario "can't change distributor or order cycle once order has been finalized" do
|
||||
|
||||
@@ -168,15 +168,6 @@ module WebHelper
|
||||
select_select2_result(value)
|
||||
end
|
||||
|
||||
# Deprecated: Use have_select2 instead (spec/support/matchers/select2_matchers.rb)
|
||||
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
|
||||
|
||||
def open_select2(selector)
|
||||
page.execute_script "jQuery('#{selector}').select2('open');"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user