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:
Arthur Vieira
2022-05-26 09:47:12 -03:00
parent 95010fcd12
commit e0241b6866

View File

@@ -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