Handle expected errors in FileCreate & FileUpdate API (#11643)
as title needed for #11641
This commit is contained in:
parent
34b6983f56
commit
b636cd6fd4
4 changed files with 57 additions and 4 deletions
|
@ -208,7 +208,7 @@ func TestAPIUpdateFile(t *testing.T) {
|
|||
updateFileOptions.SHA = "badsha"
|
||||
url = fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo1.Name, treePath, token2)
|
||||
req = NewRequestWithJSON(t, "PUT", url, &updateFileOptions)
|
||||
resp = session.MakeRequest(t, req, http.StatusInternalServerError)
|
||||
resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||
expectedAPIError := context.APIError{
|
||||
Message: "sha does not match [given: " + updateFileOptions.SHA + ", expected: " + correctSHA + "]",
|
||||
URL: setting.API.SwaggerURL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue