diff --git a/app/models/spree/variant_decorator.rb b/app/models/spree/variant_decorator.rb index 0993057450..5cd5c39155 100644 --- a/app/models/spree/variant_decorator.rb +++ b/app/models/spree/variant_decorator.rb @@ -9,12 +9,12 @@ Spree::Variant.class_eval do accepts_nested_attributes_for :images validates_presence_of :unit_value, - if: -> v { %w(weight volume).include? v.product.andand.variant_unit }, - unless: :is_master + if: -> v { %w(weight volume).include? v.product.andand.variant_unit }, + unless: :is_master validates_presence_of :unit_description, - if: -> v { v.product.andand.variant_unit.present? && v.unit_value.nil? }, - unless: :is_master + if: -> v { v.product.andand.variant_unit.present? && v.unit_value.nil? }, + unless: :is_master before_validation :update_weight_from_unit_value, if: -> v { v.product.present? } after_save :update_units diff --git a/spec/features/consumer/shopping/shopping_spec.rb b/spec/features/consumer/shopping/shopping_spec.rb index e70377cffc..a47b73ba6c 100644 --- a/spec/features/consumer/shopping/shopping_spec.rb +++ b/spec/features/consumer/shopping/shopping_spec.rb @@ -119,7 +119,6 @@ feature "As a consumer I want to shop with a distributor", js: true do page.should have_price "$53.00" # Product price should be listed as the lesser of these - #page.should have_selector 'tr.product > td', text: "from $43.00" page.should have_price "$43.00" end end