Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spree Upgrade] Fetch existing user address for the customer details in the edit orders page (1 broken test) #3107

Closed
luisramos0 opened this issue Nov 21, 2018 · 0 comments
Assignees

Comments

@luisramos0
Copy link
Contributor

Fix admin/orders_spec spec related to "filling customer details" and making sure user addresses are used in new orders.

Thsi error below can be easily fixed. It's caused by the fact that the factory order_with_totals_and_distribution already has a shipment, so we can't add a new shipment to the order.
Instead of
https://github.com/openfoodfoundation/openfoodnetwork/blob/2-0-stable/spec/features/admin/orders_spec.rb#L153
we can set the order ship_address and the existing shipment.address.
But after this problem is solved, we get to the main issue, which is that the create order page is broken.
Same in #2938 where it will also hit the same problem after the "line items blank" issue is solved.

I dont think we should fix this specific issue now, we should first fix the "new order" page.

5) 
    As an administrator
    I want to manage orders
 filling customer details
     Failure/Error: @order.shipments << create(:shipment_with, :shipping_method, shipping_method: shipping_method)
     
     ActiveRecord::RecordNotUnique:
       PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_spree_shipments_on_order_id"
       DETAIL:  Key (order_id)=(10) already exists.
       : UPDATE "spree_shipments" SET "order_id" = 10, "updated_at" = '2018-11-20 06:40:54.692941' WHERE "spree_shipments"."id" = 11
     # ./spec/features/admin/orders_spec.rb:153:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # PG::UniqueViolation:
     #   ERROR:  duplicate key value violates unique constraint "index_spree_shipments_on_order_id"
     #   DETAIL:  Key (order_id)=(10) already exists.
     #   ./spec/features/admin/orders_spec.rb:153:in `block (2 levels) in <top (required)>'

@luisramos0 luisramos0 changed the title [Spree Upgrade] [Spree Upgrade][Admin/Orders/New] New orders page - user address is used in new orders (1 broken test) Nov 21, 2018
@luisramos0 luisramos0 assigned luisramos0 and unassigned luisramos0 Dec 27, 2018
@luisramos0 luisramos0 changed the title [Spree Upgrade][Admin/Orders/New] New orders page - user address is used in new orders (1 broken test) [Spree Upgrade] Fetch existing user address for the customer details in the edit orders page (1 broken test) Feb 1, 2019
@luisramos0 luisramos0 self-assigned this Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant