Skip to content

Conversation

@rafalkosla101
Copy link
Member

No description provided.

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.

3 participants