aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration/pull_status_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/pull_status_test.go')
-rw-r--r--tests/integration/pull_status_test.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/integration/pull_status_test.go b/tests/integration/pull_status_test.go
index e60d17edc0..736d1ee4f0 100644
--- a/tests/integration/pull_status_test.go
+++ b/tests/integration/pull_status_test.go
@@ -70,7 +70,12 @@ func TestPullCreate_CommitStatus(t *testing.T) {
for _, status := range statusList {
// Call API to add status for commit
- t.Run("CreateStatus", doAPICreateCommitStatus(testCtx, commitID, status))
+ t.Run("CreateStatus", doAPICreateCommitStatus(testCtx, commitID, api.CreateStatusOption{
+ State: status,
+ TargetURL: "http://test.ci/",
+ Description: "",
+ Context: "testci",
+ }))
req = NewRequestf(t, "GET", "/user1/repo1/pulls/1/commits")
resp = session.MakeRequest(t, req, http.StatusOK)
@@ -88,15 +93,13 @@ func TestPullCreate_CommitStatus(t *testing.T) {
})
}
-func doAPICreateCommitStatus(ctx APITestContext, commitID string, status api.CommitStatusState) func(*testing.T) {
+func doAPICreateCommitStatus(ctx APITestContext, commitID string, data api.CreateStatusOption) func(*testing.T) {
return func(t *testing.T) {
- req := NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/statuses/%s?token=%s", ctx.Username, ctx.Reponame, commitID, ctx.Token),
- api.CreateStatusOption{
- State: status,
- TargetURL: "http://test.ci/",
- Description: "",
- Context: "testci",
- },
+ req := NewRequestWithJSON(
+ t,
+ http.MethodPost,
+ fmt.Sprintf("/api/v1/repos/%s/%s/statuses/%s?token=%s", ctx.Username, ctx.Reponame, commitID, ctx.Token),
+ data,
)
if ctx.ExpectedCode != 0 {
ctx.Session.MakeRequest(t, req, ctx.ExpectedCode)