mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-22 05:18:51 +00:00
Correctly include order id in return auth spec
The route to update a return authorization must include the order number
as id:
/admin/orders/:order_id/return_authorizations/:id(.:format)
The spec only worked because the controller's ivars were not reset
between requests and the order was already set. But Rails 7 will reset
the ivars and it failed finding the order without a given id.
This commit is contained in:
@@ -27,7 +27,8 @@ module Spree
|
||||
reset_controller_environment
|
||||
|
||||
# Update return authorization
|
||||
spree_put :update, id: return_authorization.id,
|
||||
spree_put :update, order_id: order.number,
|
||||
id: return_authorization.id,
|
||||
return_authorization: { amount: "10.2", reason: "half broken" }
|
||||
|
||||
expect(response).to redirect_to spree.admin_order_return_authorizations_url(order.number)
|
||||
|
||||
Reference in New Issue
Block a user