summaryrefslogtreecommitdiffstats
path: root/integrations/api_issue_label_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrations/api_issue_label_test.go')
-rw-r--r--integrations/api_issue_label_test.go18
1 files changed, 8 insertions, 10 deletions
diff --git a/integrations/api_issue_label_test.go b/integrations/api_issue_label_test.go
index 42bfedf32f..94b487377e 100644
--- a/integrations/api_issue_label_test.go
+++ b/integrations/api_issue_label_test.go
@@ -53,21 +53,21 @@ func TestAPIModifyLabels(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
- //ListLabels
+ // ListLabels
req = NewRequest(t, "GET", urlStr)
resp = session.MakeRequest(t, req, http.StatusOK)
var apiLabels []*api.Label
DecodeJSON(t, resp, &apiLabels)
assert.Len(t, apiLabels, 2)
- //GetLabel
+ // GetLabel
singleURLStr := fmt.Sprintf("/api/v1/repos/%s/%s/labels/%d?token=%s", owner.Name, repo.Name, dbLabel.ID, token)
req = NewRequest(t, "GET", singleURLStr)
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &apiLabel)
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
- //EditLabel
+ // EditLabel
newName := "LabelNewName"
newColor := "09876a"
newColorWrong := "09g76a"
@@ -83,10 +83,9 @@ func TestAPIModifyLabels(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
- //DeleteLabel
+ // DeleteLabel
req = NewRequest(t, "DELETE", singleURLStr)
session.MakeRequest(t, req, http.StatusNoContent)
-
}
func TestAPIAddIssueLabels(t *testing.T) {
@@ -173,21 +172,21 @@ func TestAPIModifyOrgLabels(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
- //ListLabels
+ // ListLabels
req = NewRequest(t, "GET", urlStr)
resp = session.MakeRequest(t, req, http.StatusOK)
var apiLabels []*api.Label
DecodeJSON(t, resp, &apiLabels)
assert.Len(t, apiLabels, 4)
- //GetLabel
+ // GetLabel
singleURLStr := fmt.Sprintf("/api/v1/orgs/%s/labels/%d?token=%s", owner.Name, dbLabel.ID, token)
req = NewRequest(t, "GET", singleURLStr)
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &apiLabel)
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
- //EditLabel
+ // EditLabel
newName := "LabelNewName"
newColor := "09876a"
newColorWrong := "09g76a"
@@ -203,8 +202,7 @@ func TestAPIModifyOrgLabels(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
- //DeleteLabel
+ // DeleteLabel
req = NewRequest(t, "DELETE", singleURLStr)
session.MakeRequest(t, req, http.StatusNoContent)
-
}