mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Unless order is complete, /cart could be updated
Split_checkout introduced new state for an order Update specs as well Follow up #8944
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
%tbody#line_items{"data-hook" => ""}
|
||||
= render partial: 'line_item', collection: order_form.object.line_items, locals: {order_form: order_form}
|
||||
|
||||
= render 'bought' if show_bought_items? && @order.cart?
|
||||
= render 'bought' if show_bought_items? && !@order.complete?
|
||||
|
||||
%tfoot#edit-cart
|
||||
= render 'spree/orders/form/cart_actions_row' unless @order.complete?
|
||||
|
||||
@@ -887,12 +887,22 @@ describe "As a consumer, I want to checkout my order", js: true do
|
||||
order_cycle: order_cycle, distributor: distributor, user_id: order.user_id)
|
||||
}
|
||||
|
||||
it "informs about previous orders if distributor allow order changes" do
|
||||
order.distributor.allow_order_changes = true
|
||||
order.distributor.save
|
||||
visit checkout_step_path(:summary)
|
||||
context "when distributor allows order changes" do
|
||||
before do
|
||||
order.distributor.allow_order_changes = true
|
||||
order.distributor.save
|
||||
visit checkout_step_path(:summary)
|
||||
end
|
||||
|
||||
expect(page).to have_content("You have an order for this order cycle already.")
|
||||
it "informs about previous orders" do
|
||||
expect(page).to have_content("You have an order for this order cycle already.")
|
||||
end
|
||||
|
||||
it "show a link to /cart#bought-products page" do
|
||||
expect(page).to have_link("cart", href: "/cart#bought-products")
|
||||
click_on "cart"
|
||||
expect(page).to have_text "#{prev_order.line_items.length} additional items already confirmed for this order cycle"
|
||||
end
|
||||
end
|
||||
|
||||
it "don't display any message if distributor don't allow order changes" do
|
||||
|
||||
Reference in New Issue
Block a user