Skip to content

Commit 3721358

Browse files
committed
fix test
1 parent 6a56389 commit 3721358

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

routers/api/v1/repo/file.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,8 @@ func DeleteFile(ctx *context.APIContext) {
751751
// "$ref": "#/responses/error"
752752
// "404":
753753
// "$ref": "#/responses/error"
754+
// "422":
755+
// "$ref": "#/responses/error"
754756
// "423":
755757
// "$ref": "#/responses/repoArchivedError"
756758

templates/swagger/v1_json.tmpl

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/api_repo_file_delete_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestAPIDeleteFile(t *testing.T) {
112112
deleteFileOptions.SHA = "badsha"
113113
req = NewRequestWithJSON(t, "DELETE", fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s", user2.Name, repo1.Name, treePath), &deleteFileOptions).
114114
AddTokenAuth(token2)
115-
MakeRequest(t, req, http.StatusBadRequest)
115+
MakeRequest(t, req, http.StatusUnprocessableEntity)
116116

117117
// Test creating a file in repo16 by user4 who does not have write access
118118
fileID++

0 commit comments

Comments
 (0)