From e5fdc896590601b289a3a164fa2e19a1dd810487 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 1 Feb 2019 22:13:26 +0000 Subject: [PATCH] Fix distributor change spec in admin orders spec --- spec/features/admin/orders_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/features/admin/orders_spec.rb b/spec/features/admin/orders_spec.rb index 738b172249..dfcffca1c7 100644 --- a/spec/features/admin/orders_spec.rb +++ b/spec/features/admin/orders_spec.rb @@ -101,10 +101,11 @@ feature %q{ scenario "displays error when incorrect distribution for products is chosen" do d = create(:distributor_enterprise) oc = create(:simple_order_cycle, distributors: [d]) - puts d.name - puts @distributor.name - @order.state = 'cart'; @order.completed_at = nil; @order.save + # Moves the order back to the cart state + # A nil user keeps the order in the cart state + # Even if the edit page tries to automatically progress the order workflow + @order.state = 'cart'; @order.user = nil; @order.completed_at = nil; @order.save quick_login_as_admin visit '/admin/orders'