mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fixed setting shipping_method in the order through order.shipments in proxy_order_spec, lib/open_food_network/customers_report_spec and features/admin/shipping_methods_spec
This commit is contained in:
@@ -51,7 +51,9 @@ feature 'shipping methods' do
|
||||
|
||||
scenario "deleting a shipping method referenced by an order" do
|
||||
o = create(:order)
|
||||
o.shipping_method = @sm
|
||||
shipment = create(:shipment)
|
||||
shipment.add_shipping_method(@sm, true)
|
||||
o.shipments << shipment
|
||||
o.save!
|
||||
|
||||
visit_delete spree.admin_shipping_method_path(@sm)
|
||||
|
||||
@@ -45,7 +45,7 @@ module OpenFoodNetwork
|
||||
a = create(:address)
|
||||
d = create(:distributor_enterprise)
|
||||
o = create(:order, distributor: d, bill_address: a)
|
||||
o.shipping_method = create(:shipping_method)
|
||||
o.shipments << create(:shipment)
|
||||
|
||||
subject.stub(:orders).and_return [o]
|
||||
subject.table.should == [[
|
||||
|
||||
@@ -77,7 +77,8 @@ describe ProxyOrder, type: :model do
|
||||
|
||||
describe "resume" do
|
||||
let!(:payment_method) { create(:payment_method) }
|
||||
let(:order) { create(:order_with_totals, shipping_method: create(:shipping_method)) }
|
||||
let!(:shipment) { create(:shipment) }
|
||||
let(:order) { create(:order_with_totals, shipments: [shipment]) }
|
||||
let(:proxy_order) { create(:proxy_order, order: order, canceled_at: Time.zone.now) }
|
||||
let(:order_cycle) { proxy_order.order_cycle }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user