diff --git a/app/assets/javascripts/admin/products/controllers/edit_units_controller.js.coffee b/app/assets/javascripts/admin/products/controllers/edit_units_controller.js.coffee index b5ef2847b4..196ca47319 100644 --- a/app/assets/javascripts/admin/products/controllers/edit_units_controller.js.coffee +++ b/app/assets/javascripts/admin/products/controllers/edit_units_controller.js.coffee @@ -9,7 +9,7 @@ angular.module("admin.products").controller "editUnitsCtrl", ($scope, VariantUni if $scope.product.variant_unit == 'items' $scope.variant_unit_with_scale = 'items' else - $scope.variant_unit_with_scale = $scope.product.variant_unit + '_' + $scope.product.variant_unit_scale + $scope.variant_unit_with_scale = $scope.product.variant_unit + '_' + $scope.product.variant_unit_scale.replace(/\.0$/, ''); $scope.setFields = -> if $scope.variant_unit_with_scale == 'items' diff --git a/spec/features/admin/products_spec.rb b/spec/features/admin/products_spec.rb index 13c87f3944..9e4544f657 100644 --- a/spec/features/admin/products_spec.rb +++ b/spec/features/admin/products_spec.rb @@ -488,7 +488,7 @@ feature ' expect(flash_message).to eq('Product "a product" has been successfully updated!') product.reload expect(product.variant_unit).to eq(var_unit) - # TODO -> expect(page).to have_select('product_variant_unit_with_scale', :selected => dropdown_option) + expect(page).to have_select('product_variant_unit_with_scale', selected: dropdown_option) expect(product.variant_unit_scale).to eq(var_unit_scale) end end