mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Replace usages of update_attributes! with usage of update!
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user