mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Remove test associated without 'unlock' selected
Leaves the other test that should be the default behaviour and renames it accordingly.
This commit is contained in:
@@ -273,28 +273,11 @@ describe Api::V0::ShipmentsController, type: :controller do
|
||||
expect(order.payment_state).to eq "balance_due" # total changed, payment is due
|
||||
end
|
||||
|
||||
context "using the 'unlock' parameter with closed adjustments" do
|
||||
before do
|
||||
order.shipment_adjustments.each(&:close)
|
||||
end
|
||||
|
||||
it "does not update closed adjustments without unlock option" do
|
||||
params[:shipment][:unlock] = "no"
|
||||
|
||||
expect {
|
||||
api_put :update, params
|
||||
expect(response.status).to eq 200
|
||||
}.to_not change { order.reload.shipment.fee_adjustment.amount }
|
||||
end
|
||||
|
||||
it "updates closed adjustments with unlock option selected" do
|
||||
params[:shipment][:unlock] = "yes"
|
||||
|
||||
expect {
|
||||
api_put :update, params
|
||||
expect(response.status).to eq 200
|
||||
}.to change { order.reload.shipment.fee_adjustment.amount }
|
||||
end
|
||||
it "updates closed adjustments" do
|
||||
expect {
|
||||
api_put :update, params
|
||||
expect(response.status).to eq 200
|
||||
}.to change { order.reload.shipment.fee_adjustment.amount }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user