diff --git a/app/assets/javascripts/admin/variant_overrides/controllers/variant_overrides_controller.js.coffee b/app/assets/javascripts/admin/variant_overrides/controllers/variant_overrides_controller.js.coffee index 1bf77e160b..4598ad817d 100644 --- a/app/assets/javascripts/admin/variant_overrides/controllers/variant_overrides_controller.js.coffee +++ b/app/assets/javascripts/admin/variant_overrides/controllers/variant_overrides_controller.js.coffee @@ -14,8 +14,8 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl", $scope.selectView = Views.selectView $scope.currentView = -> Views.currentView $scope.onDemandOptions = [ - { description: t('js.yes'), value: true }, - { description: t('js.no'), value: false } + { description: t('js.variant_overrides.on_demand.yes'), value: true }, + { description: t('js.variant_overrides.on_demand.no'), value: false } ] $scope.views = Views.setViews diff --git a/config/locales/en.yml b/config/locales/en.yml index 25a5fcc179..9bb981c7f3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2596,6 +2596,9 @@ See the %{link} to find out more about %{sitename}'s features and to start using now_out_of_stock: is now out of stock. only_n_remainging: "now only has %{num} remaining." variant_overrides: + on_demand: + "yes": "Yes" + "no": "No" inventory_products: "Inventory Products" hidden_products: "Hidden Products" new_products: "New Products" diff --git a/spec/features/admin/variant_overrides_spec.rb b/spec/features/admin/variant_overrides_spec.rb index 1421cb496c..07273dfc19 100644 --- a/spec/features/admin/variant_overrides_spec.rb +++ b/spec/features/admin/variant_overrides_spec.rb @@ -141,7 +141,7 @@ feature %q{ fill_in "variant-overrides-#{variant.id}-sku", with: 'NEWSKU' fill_in "variant-overrides-#{variant.id}-price", with: '777.77' fill_in "variant-overrides-#{variant.id}-count_on_hand", with: '123' - select I18n.t("js.yes"), from: "variant-overrides-#{variant.id}-on_demand" + select I18n.t("js.variant_overrides.on_demand.yes"), from: "variant-overrides-#{variant.id}-on_demand" page.should have_content "Changes to one override remain unsaved." expect do @@ -236,7 +236,7 @@ feature %q{ it "product values are affected by overrides" do page.should have_input "variant-overrides-#{variant.id}-price", with: '77.77', placeholder: '1.23' page.should have_input "variant-overrides-#{variant.id}-count_on_hand", with: '11111', placeholder: '12' - expect(page).to have_select "variant-overrides-#{variant.id}-on_demand", selected: I18n.t("js.yes") + expect(page).to have_select "variant-overrides-#{variant.id}-on_demand", selected: I18n.t("js.variant_overrides.on_demand.yes") end it "updates existing overrides" do @@ -257,14 +257,14 @@ feature %q{ end it "updates on_demand settings" do - select I18n.t("js.no"), from: "variant-overrides-#{variant.id}-on_demand" + select I18n.t("js.variant_overrides.on_demand.no"), from: "variant-overrides-#{variant.id}-on_demand" click_button I18n.t("save_changes") expect(page).to have_content I18n.t("js.changes_saved") vo.reload expect(vo.on_demand).to eq(false) - select I18n.t("js.yes"), from: "variant-overrides-#{variant.id}-on_demand" + select I18n.t("js.variant_overrides.on_demand.yes"), from: "variant-overrides-#{variant.id}-on_demand" click_button I18n.t("save_changes") expect(page).to have_content I18n.t("js.changes_saved")