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:
Maikel Linke
2023-03-07 08:38:30 +11:00
parent 5dd2737811
commit 3dc3ebe584

View File

@@ -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)