summaryrefslogtreecommitdiffstats
path: root/integrations/api_pull_test.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-03-23 05:54:07 +0100
committerGitHub <noreply@github.com>2022-03-23 12:54:07 +0800
commit3f280f89e7471a6dcdaefccc64a8d39188970e63 (patch)
treeff09b6dcb00b4c0ff0c436c4523d89a5c13f3a94 /integrations/api_pull_test.go
parent395117d3014124b9147a1aabf76ee175e720b275 (diff)
downloadgitea-3f280f89e7471a6dcdaefccc64a8d39188970e63.tar.gz
gitea-3f280f89e7471a6dcdaefccc64a8d39188970e63.zip
Update HTTP status codes to modern codes (#18063)
* 2xx/3xx/4xx/5xx -> http.Status... * http.StatusFound -> http.StatusTemporaryRedirect * http.StatusMovedPermanently -> http.StatusPermanentRedirect
Diffstat (limited to 'integrations/api_pull_test.go')
-rw-r--r--integrations/api_pull_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/integrations/api_pull_test.go b/integrations/api_pull_test.go
index b6b8ad8734..a1c2a4c3e6 100644
--- a/integrations/api_pull_test.go
+++ b/integrations/api_pull_test.go
@@ -77,7 +77,7 @@ func TestAPICreatePullSuccess(t *testing.T) {
Base: "master",
Title: "create a failure pr",
})
- session.MakeRequest(t, req, 201)
+ session.MakeRequest(t, req, http.StatusCreated)
session.MakeRequest(t, req, http.StatusUnprocessableEntity) // second request should fail
}
@@ -105,7 +105,7 @@ func TestAPICreatePullWithFieldsSuccess(t *testing.T) {
req := NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls?token=%s", owner10.Name, repo10.Name, token), opts)
- res := session.MakeRequest(t, req, 201)
+ res := session.MakeRequest(t, req, http.StatusCreated)
pull := new(api.PullRequest)
DecodeJSON(t, res, pull)
@@ -165,7 +165,7 @@ func TestAPIEditPull(t *testing.T) {
Title: "create a success pr",
})
pull := new(api.PullRequest)
- resp := session.MakeRequest(t, req, 201)
+ resp := session.MakeRequest(t, req, http.StatusCreated)
DecodeJSON(t, resp, pull)
assert.EqualValues(t, "master", pull.Base.Name)
@@ -173,12 +173,12 @@ func TestAPIEditPull(t *testing.T) {
Base: "feature/1",
Title: "edit a this pr",
})
- resp = session.MakeRequest(t, req, 201)
+ resp = session.MakeRequest(t, req, http.StatusCreated)
DecodeJSON(t, resp, pull)
assert.EqualValues(t, "feature/1", pull.Base.Name)
req = NewRequestWithJSON(t, http.MethodPatch, fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d?token=%s", owner10.Name, repo10.Name, pull.Index, token), &api.EditPullRequestOption{
Base: "not-exist",
})
- session.MakeRequest(t, req, 404)
+ session.MakeRequest(t, req, http.StatusNotFound)
}