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
|
@ -189,7 +189,7 @@ func TestAPICreateFile(t *testing.T) {
|
|||
treePath = "README.md"
|
||||
url = fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo1.Name, treePath, token2)
|
||||
req = NewRequestWithJSON(t, "POST", url, &createFileOptions)
|
||||
resp = session.MakeRequest(t, req, http.StatusInternalServerError)
|
||||
resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||
expectedAPIError := context.APIError{
|
||||
Message: "repository file already exists [path: " + treePath + "]",
|
||||
URL: setting.API.SwaggerURL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue