diff --git a/app/models/spree/gateway/pay_pal_express.rb b/app/models/spree/gateway/pay_pal_express.rb index bc7d8cef64..7b64e37624 100644 --- a/app/models/spree/gateway/pay_pal_express.rb +++ b/app/models/spree/gateway/pay_pal_express.rb @@ -87,7 +87,7 @@ module Spree ) refund_transaction_response = provider.refund_transaction(refund_transaction) if refund_transaction_response.success? - payment.source.update_attributes( + payment.source.update( refunded_at: Time.now, refund_transaction_id: refund_transaction_response.RefundTransactionID, state: "refunded", diff --git a/engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb b/engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb index 23ecc9c997..ee4d754b49 100644 --- a/engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb +++ b/engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb @@ -28,7 +28,7 @@ module OrderManagement let(:payment_method) { create(:payment_method) } it "returns the pending payment with no change" do - expect(payment).to_not receive(:update_attributes) + expect(payment).to_not receive(:update) expect(payment_setup.call!).to eq payment end end @@ -38,7 +38,7 @@ module OrderManagement context "and the card is already set (the payment source is a credit card)" do it "returns the pending payment with no change" do - expect(payment).to_not receive(:update_attributes) + expect(payment).to_not receive(:update) expect(payment_setup.call!).to eq payment end end @@ -54,7 +54,7 @@ module OrderManagement it "adds an error to the order and does not update the payment" do payment_setup.call! - expect(payment).to_not receive(:update_attributes) + expect(payment).to_not receive(:update) expect(payment_setup.call!).to eq payment expect(order.errors[:base].first).to eq "There are no authorised "\ "credit cards available to charge" @@ -80,7 +80,7 @@ module OrderManagement it "adds an error to the order and does not update the payment" do payment_setup.call! - expect(payment).to_not receive(:update_attributes) + expect(payment).to_not receive(:update) expect(payment_setup.call!).to eq payment expect(order.errors[:base].first).to eq "There are no authorised "\ "credit cards available to charge" diff --git a/spec/controllers/checkout_controller_spec.rb b/spec/controllers/checkout_controller_spec.rb index 9d1620c284..f52d901b74 100644 --- a/spec/controllers/checkout_controller_spec.rb +++ b/spec/controllers/checkout_controller_spec.rb @@ -291,7 +291,7 @@ describe CheckoutController, type: :controller do allow(controller).to receive(:current_order).and_return(order) end - it "returns errors and flash if order.update_attributes fails" do + it "returns errors and flash if order.update fails" do spree_post :update, format: :json, order: {} expect(response.status).to eq(400) expect(response.body).to eq({ errors: assigns[:order].errors, flash: { error: order.errors.full_messages.to_sentence } }.to_json) diff --git a/spec/requests/api/orders_spec.rb b/spec/requests/api/orders_spec.rb index 556ff4a619..41a050ee8f 100644 --- a/spec/requests/api/orders_spec.rb +++ b/spec/requests/api/orders_spec.rb @@ -52,7 +52,7 @@ describe 'api/v0/orders', type: :request do context "and queried by distributor id" do let(:'q[distributor_id_eq]') { order_dist_2.distributor.id } - before { order_dist_2.distributor.update_attributes owner: user } + before { order_dist_2.distributor.update owner: user } run_test! do |response| expect(response).to have_http_status(200) @@ -119,7 +119,7 @@ describe 'api/v0/orders', type: :request do order_dist_2.order_cycle.id } - before { order_dist_2.distributor.update_attributes owner: user } + before { order_dist_2.distributor.update owner: user } run_test! do |response| expect(response).to have_http_status(200)