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] Fix subscriptions.shipping_method_id (13 broken specs) #2696

Closed
luisramos0 opened this issue Sep 12, 2018 · 4 comments
Closed
Assignees

Comments

@luisramos0
Copy link
Contributor

luisramos0 commented Sep 12, 2018

Subscriptions and spree 2 shipping_methods will need to work together.
There's a column subscriptions.shipping_method_id that, I believe, is used to create orders in a subscription. We need to verify how this process works with the new spree 2 way of creating shipments from shipping methods.

Files referencing shipping_method_id:
- app/serializers/api/admin/subscription_serializer.rb (this used to be a separate issue #2732 that can be reopened if appropriate)
- app/models/proxy_order.rb
- app/services/order_syncer.rb
- app/assets/javascripts/admin/subscriptions/services/subscription_functions.js.coffee
- app/views/admin/subscriptions/_details.html.haml
- app/views/admin/subscriptions/_table.html.haml
- spec/controllers/admin/subscriptions_controller_spec.rb
- spec/services/subscription_form_spec.rb
- spec/services/order_syncer_spec.rb
- spec/features/admin/subscriptions_spec.rb
- spec/controllers/admin/proxy_orders_controller_spec.rb
- spec/javascripts/unit/admin/subscriptions/services/subscription_functions_spec.js.coffee

@luisramos0
Copy link
Contributor Author

Moving app/services/order_factory.rb and respective spec/services/order_factory_spec.rb from #2693 to this issue as it's related to subscriptions only.
I'll fix all other parts referencing shipping_method before getting to subscriptions.

@luisramos0
Copy link
Contributor Author

After a lot more handling of shipping_methods and shipments and shipping_method_ids, I suspect this shipping_method_id in subscriptions is simply holding the shipping_method_id to be used in the recurring orders, and that can be done by injecting the shipping_method_id in the order.shipment, just like it's done in the checkout controller in #2683
Based on this assumption, I am leaving this verification/adaptation for later.

@luisramos0
Copy link
Contributor Author

One spec in subscription_form_spec is broken with errors related to shipments.
And 8 specs are failing with related errors in spec/services/order_syncer_spec.rb

@luisramos0 luisramos0 changed the title [Spree Upgrade] Verify how subscriptions.shipping_method_id adapts to spree 2 shipping_methods model [Spree Upgrade] Fix subscriptions.shipping_method_id (9 broken specs) Jan 25, 2019
@luisramos0
Copy link
Contributor Author

Additionally, 4 specs are breaking with similar error (we need to set shipping address or shipping method at some point) in spec/models/proxy_order_spec (job 4)

Error:

ensure_available_shipping_rates shipping_method…
Cannot transition state via :next from :address (Reason(s): We are unable to ship the selected items to your shipping address. Please choose another shipping address.)

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

2 participants