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
Revert "Revert "Update PATCH /sections/:id in dashboard, deprecate pegasus endpoint"" #22951
Revert "Revert "Update PATCH /sections/:id in dashboard, deprecate pegasus endpoint"" #22951
Conversation
# This endpoint needs to satisfy two endpoint formats for getting script_id | ||
# This should be updated soon to always expect params[:script_id] | ||
script_id = params[:script][:id] if params[:script] | ||
script_id ||= params[:script_id] |
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.
new - fixes bug where one consumer provides params[:script_id]
and the other provides params[:script][:id]
assert_response :success | ||
section.reload | ||
assert_equal(@script_in_course.id, section.script_id) | ||
end |
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.
new - tests case where one consumer provides params[:script_id]
and the other provides params[:script][:id]
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.
Looks great! Thanks for covering with a regression test.
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.
Looks good!
Reverts #22949
The original PR (#22902) that updated
PATCH /sections/:id
went out with yesterday's deploy with a bug, so Dave did a late deploy to help me revert the original PR. This PR reverts that revert and fixes the bug!I added "new" comments to the new parts so you can see the changes that differ from the original PR.
Background
PATCH /sections/:id
expected to receiveparams[:script_id]
, which is what the previous consumer supplied, but the new consumer (teacherSectionsRedux
) currently (but not for long...) suppliesparams[:script][:id]
, which meant scripts could not be updated.I added a unit test to catch this case, and will push a follow-up PR with a feature test to cover updating sections as well (once #22955 has been merged, which adds similar feature test coverage)