mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix shipping adjustment basic test in adjustment_spec by removing extra shipping_method from test shipment
This commit is contained in:
@@ -374,6 +374,7 @@ FactoryBot.define do
|
||||
shipping_method { create :shipping_method }
|
||||
end
|
||||
after(:create) do |shipment, evaluator|
|
||||
shipment.shipping_rates.destroy_all # remove existing shipping_rates from shipment
|
||||
shipment.add_shipping_method(evaluator.shipping_method, true)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -61,11 +61,13 @@ module Spree
|
||||
describe "Shipment adjustments" do
|
||||
let(:shipping_method) { create(:shipping_method_with, :flat_rate) }
|
||||
let(:shipment) { create(:shipment_with, :shipping_method, shipping_method: shipping_method) }
|
||||
let!(:order) { create(:order, distributor: hub, shipments: [shipment]) }
|
||||
let!(:order) { create(:order, distributor: hub) }
|
||||
let(:hub) { create(:distributor_enterprise, charges_sales_tax: true) }
|
||||
let!(:line_item) { create(:line_item, order: order) }
|
||||
let(:adjustment) { order.adjustments(:reload).shipping.first }
|
||||
|
||||
before { order.shipments = [shipment] }
|
||||
|
||||
it "has a shipping charge of $50" do
|
||||
adjustment.amount.should == 50
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user