Replace usages of update_attributes! with usage of update!

This commit is contained in:
Luis Ramos
2021-05-09 22:09:48 +01:00
committed by Andy Brett
parent 341f6c9f62
commit fb560089b9
3 changed files with 5 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ describe LineItemsController, type: :controller do
context "where the item's order is associated with the current user" do
before do
order.update_attributes!(user_id: user.id)
order.update!(user_id: user.id)
allow(controller).to receive_messages spree_current_user: item.order.user
end
@@ -67,7 +67,7 @@ describe LineItemsController, type: :controller do
end
context "with an order cycle and distributor" do
before { order.update_attributes!(order_cycle_id: order_cycle.id, distributor_id: distributor.id) }
before { order.update!(order_cycle_id: order_cycle.id, distributor_id: distributor.id) }
context "where changes are not allowed" do
it "denies deletion" do
@@ -77,7 +77,7 @@ describe LineItemsController, type: :controller do
end
context "where changes are allowed" do
before { distributor.update_attributes!(allow_order_changes: true) }
before { distributor.update!(allow_order_changes: true) }
it "deletes the line item" do
delete :destroy, params: params

View File

@@ -533,7 +533,7 @@ describe Spree::OrdersController, type: :controller do
end
before do
order.update_attributes!(order_cycle_id: order_cycle.id, distributor_id: distributor.id)
order.update!(order_cycle_id: order_cycle.id, distributor_id: distributor.id)
end
it "returns the order" do

View File

@@ -26,7 +26,7 @@ feature "Order Management", js: true do
before do
# For some reason, both bill_address and ship_address are not set
# automatically.
order.update_attributes!(
order.update!(
bill_address: bill_address,
ship_address: ship_address
)