mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update specs on shipping fee changes and mark as pending
The shipping fee and it's tax actually don't get updated correctly here (in master).
This commit is contained in:
@@ -347,8 +347,10 @@ describe Admin::BulkLineItemsController, type: :controller do
|
||||
let(:line_item_params) { { quantity: 3 } }
|
||||
let(:params) { { id: line_item1.id, order_id: order.number, line_item: line_item_params } }
|
||||
|
||||
it "correctly updates order totals and states" do
|
||||
xit "correctly updates order totals and states" do
|
||||
expect(order.total).to eq 35.0
|
||||
expect(order.shipment_adjustments.shipping.sum(:amount)).to eq 6.0
|
||||
expect(order.shipment_adjustments.tax.sum(:amount)).to eq 0.29
|
||||
expect(order.item_total).to eq 20.0
|
||||
expect(order.adjustment_total).to eq 15.0
|
||||
expect(order.included_tax_total).to eq 1.22
|
||||
@@ -360,10 +362,11 @@ describe Admin::BulkLineItemsController, type: :controller do
|
||||
spree_put :update, params
|
||||
order.reload
|
||||
|
||||
expect(order.total).to eq 61.0
|
||||
expect(order.total).to eq 67.0
|
||||
expect(order.shipment_adjustments.sum(:amount)).to eq 12.57
|
||||
expect(order.item_total).to eq 40.0
|
||||
expect(order.adjustment_total).to eq 21.0
|
||||
expect(order.included_tax_total).to eq 2.65 # Pending: this should be 3.10!
|
||||
expect(order.adjustment_total).to eq 27.0
|
||||
expect(order.included_tax_total).to eq 2.93 # Pending: taxes on enterprise fees unchanged
|
||||
expect(order.payment_state).to eq "balance_due"
|
||||
end
|
||||
end
|
||||
@@ -371,8 +374,10 @@ describe Admin::BulkLineItemsController, type: :controller do
|
||||
describe "deleting a line item" do
|
||||
let(:params) { { id: line_item1.id, order_id: order.number } }
|
||||
|
||||
it "correctly updates order totals and states" do
|
||||
xit "correctly updates order totals and states" do
|
||||
expect(order.total).to eq 35.0
|
||||
expect(order.shipment_adjustments.shipping.sum(:amount)).to eq 6.0
|
||||
expect(order.shipment_adjustments.tax.sum(:amount)).to eq 0.29
|
||||
expect(order.item_total).to eq 20.0
|
||||
expect(order.adjustment_total).to eq 15.0
|
||||
expect(order.included_tax_total).to eq 1.22
|
||||
@@ -381,10 +386,12 @@ describe Admin::BulkLineItemsController, type: :controller do
|
||||
spree_delete :destroy, params
|
||||
order.reload
|
||||
|
||||
expect(order.total).to eq 22.0
|
||||
expect(order.total).to eq 19.0
|
||||
expect(order.shipment_adjustments.shipping.sum(:amount)).to eq 3.0
|
||||
expect(order.shipment_adjustments.tax.sum(:amount)).to eq 0.14
|
||||
expect(order.item_total).to eq 10.0
|
||||
expect(order.adjustment_total).to eq 12.0
|
||||
expect(order.included_tax_total).to eq 0.99
|
||||
expect(order.adjustment_total).to eq 9.0
|
||||
expect(order.included_tax_total).to eq 0.84
|
||||
expect(order.payment_state).to eq "credit_owed"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user