Patching up our checkout flow so we don't try to create shipments before we have valid shipping addresses

This commit is contained in:
Will Marshall
2014-02-28 13:41:02 +11:00
parent 86a8b926f3
commit 1d5addb06e
4 changed files with 55 additions and 30 deletions

View File

@@ -274,14 +274,20 @@ describe Spree::Order do
order.shipping_method = create(:shipping_method, require_ship_address: false)
order.ship_address.update_attribute :firstname, "will"
order.save
order.ship_address.firstname.should == distributor.address.firstname
order.ship_address.firstname.shoul == distributor.address.firstname
end
it "does not populate the shipping address if the shipping method requires a delivery address" do
order.shipping_method = create(:shipping_method, require_ship_address: true)
order.ship_address.update_attribute :firstname, "will"
order.save
order.ship_address.firstname.should == "will"
end
it "doesn't attempt to create a shipment if the order is not yet valid" do
#Shipment.should_not_r
order.create_shipment!
end
end
end