1.5 KiB
1.5 KiB
QA procedure: remove_legacy_article_image_alias
Package: test (black-box, httptest, in-memory fakes, no live server).
Setup
- Call
validator.InitValidator(). - Build the article router exactly as
NewArticleRouterdoes after the change (no image handler), wrapped inVerifier,Authenticator,RequireCurrentTokenandRequireVerifiedUser, over fake article, image and user repositories. ReusenewMultipartFileRequestandpngBytesfromtest/media_fixtures_test.go.
HTTP checks
POST /v1/article/1/imagewith a valid PNG and a valid cookie -> 404,Createnever called.DELETE /v1/article/1/image/10with a valid cookie -> 404, image 10 still exists.POST /v1/media/with a valid PNG -> 201 withidandurl(this stays covered bymedia_library_http_test.go; confirm the case still passes after the deletions).PATCH /v1/article/1/publishstill answers as inverified_account_required_http_test.go.
Cleanup (Go)
- Delete
test/upload_article_image_http_test.go. - In
test/verified_account_required_http_test.go: remove theapi/handlers/imageimport, theimageHandlerconstruction (line 34), the router.Post("/{id}/image", ...)(line 53) and the "unverified user is refused when attaching an image" case (around line 149). - Run
task testandtask lint; nothing else may referencePostLegacyArticleImageorhandlers/image.
Manual verification
With task dev, curl -i -X POST /v1/article/1/image with a valid cookie answers 404.