-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
[Rails 6.0] Fix order adjustments spec #7589
[Rails 6.0] Fix order adjustments spec #7589
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7589 +/- ##
=======================================
Coverage 93.20% 93.20%
=======================================
Files 635 635
Lines 18136 18136
=======================================
Hits 16903 16903
Misses 1233 1233 Continue to review full report at Codecov.
|
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.
Could it be related to autoloading?
https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#autoloading
What was the error? It's difficult to review without the context. |
spec/models/spree/order_spec.rb
Outdated
payment_fee_adjustment.finalize! | ||
shipping_fee_adjustment.finalize! | ||
order.all_adjustments.payment_fee.each(&:finalize!) | ||
order.shipment_adjustments.each(&:finalize!) |
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.
We could maybe just do order.all_adjustments.each(&:finalize!)
here for simplicity? Not a big deal though.
@Matt-Yorkley you can see it in this build: https://github.com/openfoodfoundation/openfoodnetwork/runs/2536112257?check_suite_focus=true
From what I could tell the math it's doing is 2*5 + 1*3, when it should be doing 2*(5+3) (see line 1118 of the spec file). |
Alright, cool. Seems like it's an issue with the test setup as opposed to the code itself 👌 |
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.
👍
d9c9043
to
231f01d
Compare
What? Why?
Paging @Matt-Yorkley to take a look at this... I'm a bit puzzled as to what would have changed in Rails 6 to flip this spec to red. Let's see if the fix works on the current master.
What should we test?
Green build
Release notes
Updated an Order spec to prepare for Rails 6
Changelog Category: Technical changes
Dependencies
Documentation updates