Removed deprecated spec helper have_select2_option and fixed its last usage

This commit is contained in:
luisramos0
2018-09-20 23:01:23 +01:00
parent 9f7d24934d
commit 33d2b65d65
2 changed files with 1 additions and 10 deletions

View File

@@ -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

View File

@@ -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