From e0241b686681c2ed31bba4b08e2fd52b7cd24d3f Mon Sep 17 00:00:00 2001 From: Arthur Vieira Date: Thu, 26 May 2022 09:47:12 -0300 Subject: [PATCH] Remove test associated without 'unlock' selected Leaves the other test that should be the default behaviour and renames it accordingly. --- .../api/v0/shipments_controller_spec.rb | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/spec/controllers/api/v0/shipments_controller_spec.rb b/spec/controllers/api/v0/shipments_controller_spec.rb index 233a13560e..abdb5ea2bc 100644 --- a/spec/controllers/api/v0/shipments_controller_spec.rb +++ b/spec/controllers/api/v0/shipments_controller_spec.rb @@ -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