mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
13221 Add spec for checking flash error is shown when editing a shipped order
This commit is contained in:
@@ -226,6 +226,17 @@ RSpec.describe Spree::Admin::OrdersController, type: :controller do
|
||||
end
|
||||
end
|
||||
|
||||
context "when order is shipped" do
|
||||
it "redirects to order details page with flash error" do
|
||||
order.update(shipment_state: :ready)
|
||||
order.update(shipment_state: :shipped)
|
||||
spree_put :update, { id: order }
|
||||
|
||||
expect(flash[:error]).to eq "Cannot add item to shipped order"
|
||||
expect(response).to redirect_to spree.edit_admin_order_path(order)
|
||||
end
|
||||
end
|
||||
|
||||
context "with line items" do
|
||||
let!(:distributor){ create(:distributor_enterprise) }
|
||||
let!(:shipment){ create(:shipment) }
|
||||
|
||||
Reference in New Issue
Block a user