@@ -91,22 +91,22 @@ func TestAPIAddIssueLabels(t *testing.T) {
91
91
92
92
repo := models .AssertExistsAndLoadBean (t , & models.Repository {ID : 1 }).(* models.Repository )
93
93
issue := models .AssertExistsAndLoadBean (t , & models.Issue {RepoID : repo .ID }).(* models.Issue )
94
- label : = models .AssertExistsAndLoadBean (t , & models.Label {RepoID : repo .ID }).(* models.Label )
94
+ _ = models .AssertExistsAndLoadBean (t , & models.Label {RepoID : repo .ID , ID : 2 }).(* models.Label )
95
95
owner := models .AssertExistsAndLoadBean (t , & models.User {ID : repo .OwnerID }).(* models.User )
96
96
97
97
session := loginUser (t , owner .Name )
98
98
token := getTokenForLoggedInUser (t , session )
99
99
urlStr := fmt .Sprintf ("/api/v1/repos/%s/%s/issues/%d/labels?token=%s" ,
100
- owner . Name , repo .Name , issue .Index , token )
100
+ repo . OwnerName , repo .Name , issue .Index , token )
101
101
req := NewRequestWithJSON (t , "POST" , urlStr , & api.IssueLabelsOption {
102
- Labels : []int64 {label . ID },
102
+ Labels : []int64 {1 , 2 },
103
103
})
104
104
resp := session .MakeRequest (t , req , http .StatusOK )
105
105
var apiLabels []* api.Label
106
106
DecodeJSON (t , resp , & apiLabels )
107
107
assert .Len (t , apiLabels , models .GetCount (t , & models.IssueLabel {IssueID : issue .ID }))
108
108
109
- models .AssertExistsAndLoadBean (t , & models.IssueLabel {IssueID : issue .ID , LabelID : label . ID })
109
+ models .AssertExistsAndLoadBean (t , & models.IssueLabel {IssueID : issue .ID , LabelID : 2 })
110
110
}
111
111
112
112
func TestAPIReplaceIssueLabels (t * testing.T ) {
0 commit comments