-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
Delete dead code in OrdersController#update_distribution #7638
Delete dead code in OrdersController#update_distribution #7638
Conversation
I can't see any evidence that these params ever get sent to this action...
Codecov Report
@@ Coverage Diff @@
## master #7638 +/- ##
==========================================
+ Coverage 93.21% 93.26% +0.05%
==========================================
Files 635 635
Lines 18136 18129 -7
==========================================
+ Hits 16905 16908 +3
+ Misses 1231 1221 -10
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.
nice! I'd say this is a pr-no-test.
@@ -14,7 +14,7 @@ class OrdersController < ::BaseController | |||
respond_to :html | |||
respond_to :json | |||
|
|||
before_action :update_distribution, only: :update | |||
before_action :set_current_order, only: :update | |||
before_action :filter_order_params, only: :update |
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.
can you move these before_actions, only: update to beginning of the update method?
@@ -74,6 +71,10 @@ def edit | |||
end | |||
|
|||
def update | |||
set_current_order | |||
filter_order_params | |||
check_at_least_one_line_item |
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 is definitely covered by the test suite. Are you happy to merge this @Matt-Yorkley I'm with @luisramos0 on the pr-no-test. |
3702105
to
82a6bef
Compare
Moving those I think this controller needs more cleanup at some point, but maybe in another PR. For example, I'm not sure that params-mangling that's happening in |
👍 🙈 |
What? Why?
I can't see any evidence that these params ever get sent to this action containing these strings.
Correct me if I'm wrong though!
🔥🔥
What should we test?
This theoretically relates to places in the frontoffice where the user can select either the distributor or the order cycle for their current order. There's not many places where we do that. I guess just a quick check that the user can choose a shop and select an order cycle? Are there any other places or scenarios where that could theoretically happen?
Release notes
Removed some unused code from OrdersController.
Changelog Category: Technical changes