From a2f6ff7b39f93f87cfd3139c2a319f9616d50aa7 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 1 Apr 2021 12:41:58 +0100 Subject: [PATCH] Update deprecated params in checkout spec --- spec/requests/checkout/failed_checkout_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/requests/checkout/failed_checkout_spec.rb b/spec/requests/checkout/failed_checkout_spec.rb index efd44cbb31..9dade977c1 100644 --- a/spec/requests/checkout/failed_checkout_spec.rb +++ b/spec/requests/checkout/failed_checkout_spec.rb @@ -16,7 +16,7 @@ describe "checking out an order that initially fails", type: :request do let!(:shipment) { create(:shipment_with, :shipping_method, shipping_method: shipping_method) } let!(:order) { create(:order, shipments: [shipment], distributor: shop, order_cycle: order_cycle) } let(:params) do - { format: :json, order: { + { order: { shipping_method_id: shipping_method.id, payments_attributes: [{ payment_method_id: payment_method.id }], bill_address_attributes: address.attributes.slice("firstname", "lastname", "address1", "address2", "phone", "city", "zipcode", "state_id", "country_id"), @@ -46,7 +46,7 @@ describe "checking out an order that initially fails", type: :request do end it "clears shipments and payments before rendering the checkout" do - put update_checkout_path, params + put update_checkout_path, params: params, as: :json # Checking out a BogusGateway without a source fails at :payment # Shipments and payments should then be cleared before rendering checkout @@ -62,7 +62,8 @@ describe "checking out an order that initially fails", type: :request do # Use a check payment method, which should work params[:order][:payments_attributes][0][:payment_method_id] = check_payment_method.id - put update_checkout_path, params + + put update_checkout_path, params: params, as: :json expect(response.status).to be 200 order.reload