Fix order_and_distributor_report_spec by setting ofn shipping method the ofn v2 way

This commit is contained in:
luisramos0
2019-04-05 22:06:44 +01:00
parent ecc60f3b61
commit bb4cec1186

View File

@@ -20,12 +20,13 @@ module OpenFoodNetwork
let(:product) { create(:product) }
let(:shipping_method) { create(:shipping_method) }
let(:shipping_instructions) { 'pick up on thursday please!' }
let(:order) { create(:order, state: 'complete', completed_at: Time.zone.now, distributor: distributor, bill_address: bill_address, shipping_method: shipping_method, special_instructions: shipping_instructions) }
let(:order) { create(:order, state: 'complete', completed_at: Time.zone.now, distributor: distributor, bill_address: bill_address, special_instructions: shipping_instructions) }
let(:payment_method) { create(:payment_method, distributors: [distributor]) }
let(:payment) { create(:payment, payment_method: payment_method, order: order) }
let(:line_item) { create(:line_item_with_shipment, product: product, order: order) }
before do
order.select_shipping_method(shipping_method.id)
order.payments << payment
order.line_items << line_item
end