-
Notifications
You must be signed in to change notification settings - Fork 0
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
bugfix - reseting shipments after currency change #4
base: master
Are you sure you want to change the base?
Conversation
@@ -161,6 +161,9 @@ def associate | |||
def change_currency | |||
spree_authorize! :update, spree_current_order, order_token | |||
|
|||
spree_current_order.ensure_updated_shipments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic should be moved to change_currency_service
, to make the behavior consistent for all users of change currency service
end | ||
end | ||
|
||
context 'if the order has shipping methods after change' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I follow this logic, will it have shipments after the change or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will after the GetShippingRates is called(it generates a generic shipment) but the shipment will be different from the previous one - from the customer side it would like like: get products into cart -> go to checkout -> choose shipping method -> change currency to EUR -> check if user can choose shipment method and if the shipment method is not the same as used in previous currency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, could you make the name of this context more clear? The 'if' sounds like there's something that you're not sure of inside the test. Something like when user requests shipping methods after changing currency
https://www.betterspecs.org/ <- here's a nice guideline on structuring and naming test cases
No description provided.