From 6bdbdc06e79bbd70641a5115f808a03414a85521 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Tue, 20 Feb 2018 15:11:20 +1100 Subject: [PATCH] Use select2_search instead of targetted_select2_search --- app/views/admin/subscriptions/_autocomplete.html.haml | 2 +- spec/features/admin/subscriptions_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/admin/subscriptions/_autocomplete.html.haml b/app/views/admin/subscriptions/_autocomplete.html.haml index 6e2723dac7..a9d5a75a7d 100644 --- a/app/views/admin/subscriptions/_autocomplete.html.haml +++ b/app/views/admin/subscriptions/_autocomplete.html.haml @@ -8,7 +8,7 @@ %tr %td{ style: "vertical-align:top" } .field - = label_tag :add_product_name, t(:name_or_sku) + = label_tag :add_variant_id, t(:name_or_sku) %input#add_variant_id.variant_autocomplete.fullwidth{ type: 'number', ng: { model: 'newItem.variant_id' } } %td{ style: "vertical-align:top" } .field diff --git a/spec/features/admin/subscriptions_spec.rb b/spec/features/admin/subscriptions_spec.rb index 3661b5dcd7..1ea8320ecf 100644 --- a/spec/features/admin/subscriptions_spec.rb +++ b/spec/features/admin/subscriptions_spec.rb @@ -201,7 +201,7 @@ feature 'Subscriptions' do expect(page).to have_content 'Please add at least one product' # Adding a product and getting a price estimate - targetted_select2_search product1.name, from: '#add_variant_id', dropdown_css: '.select2-drop' + select2_search product1.name, from: I18n.t(:name_or_sku), dropdown_css: '.select2-drop' fill_in 'add_quantity', with: 2 click_link 'Add' within 'table#subscription-line-items tr.item', match: :first do @@ -225,7 +225,7 @@ feature 'Subscriptions' do }.to_not change(Subscription, :count) # Adding a new product - targetted_select2_search product2.name, from: '#add_variant_id', dropdown_css: '.select2-drop' + select2_search product2.name, from: I18n.t(:name_or_sku), dropdown_css: '.select2-drop' fill_in 'add_quantity', with: 3 click_link 'Add' within 'table#subscription-line-items tr.item', match: :first do @@ -315,7 +315,7 @@ feature 'Subscriptions' do expect(page).to have_content 'Please add at least one product' # Add variant2 to the subscription - targetted_select2_search product2.name, from: '#add_variant_id', dropdown_css: '.select2-drop' + select2_search product2.name, from: I18n.t(:name_or_sku), dropdown_css: '.select2-drop' fill_in 'add_quantity', with: 1 click_link 'Add' within "#sli_0" do @@ -329,7 +329,7 @@ feature 'Subscriptions' do expect(page).to have_selector '#order_form_total', text: "$7.75" # Add variant3 to the subscription (even though it is not available) - targetted_select2_search product3.name, from: '#add_variant_id', dropdown_css: '.select2-drop' + select2_search product3.name, from: I18n.t(:name_or_sku), dropdown_css: '.select2-drop' fill_in 'add_quantity', with: 1 click_link 'Add' within "#sli_1" do