mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Stylistic changes
This commit is contained in:
@@ -185,7 +185,7 @@ Spree::Product.class_eval do
|
||||
if variant_unit_changed?
|
||||
option_types.delete self.class.all_variant_unit_option_types
|
||||
option_types << variant_unit_option_type if variant_unit.present?
|
||||
variants_including_master.each { |v| v.update_units }
|
||||
variants_including_master.each &:update_units
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -27,12 +27,6 @@ module Spree
|
||||
product.should_not be_valid
|
||||
end
|
||||
|
||||
it "defaults available_on to now" do
|
||||
Timecop.freeze
|
||||
product = Product.new
|
||||
product.available_on.should == Time.now
|
||||
end
|
||||
|
||||
it "does not save when master is invalid" do
|
||||
s = create(:supplier_enterprise)
|
||||
t = create(:taxon)
|
||||
@@ -41,6 +35,12 @@ module Spree
|
||||
product.save.should be_false
|
||||
end
|
||||
|
||||
it "defaults available_on to now" do
|
||||
Timecop.freeze
|
||||
product = Product.new
|
||||
product.available_on.should == Time.now
|
||||
end
|
||||
|
||||
context "when the product has variants" do
|
||||
let(:product) do
|
||||
product = create(:simple_product)
|
||||
|
||||
Reference in New Issue
Block a user