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

bugfix - reseting shipments after currency change #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rafalkosla101
Copy link
Member

No description provided.

@@ -161,6 +161,9 @@ def associate
def change_currency
spree_authorize! :update, spree_current_order, order_token

spree_current_order.ensure_updated_shipments
Copy link
Member

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
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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

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

Successfully merging this pull request may close these issues.

2 participants