mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
Extend API to allow CRUD labels
Add Labels API
* List all labels for this repository
* Get a single label
* Create a label
* Update a label
* Delete a label
Reject duplicated label name
Add test case for LabelsService
This commit is contained in:
@@ -209,6 +209,15 @@ class JsonFormatSpec extends Specification {
|
||||
"url": "${context.baseUrl}/api/v3/repos/octocat/Hello-World/commits/$sha1/status"
|
||||
}"""
|
||||
|
||||
val apiLabel = ApiLabel(
|
||||
name = "bug",
|
||||
color = "f29513")(RepositoryName("octocat","Hello-World"))
|
||||
val apiLabelJson = s"""{
|
||||
"name": "bug",
|
||||
"color": "f29513",
|
||||
"url": "${context.baseUrl}/api/v3/repos/octocat/Hello-World/labels/bug"
|
||||
}"""
|
||||
|
||||
val apiIssue = ApiIssue(
|
||||
number = 1347,
|
||||
title = "Found a bug",
|
||||
@@ -411,6 +420,9 @@ class JsonFormatSpec extends Specification {
|
||||
"apiCombinedCommitStatus" in {
|
||||
JsonFormat(apiCombinedCommitStatus) must beFormatted(apiCombinedCommitStatusJson)
|
||||
}
|
||||
"apiLabel" in {
|
||||
JsonFormat(apiLabel) must beFormatted(apiLabelJson)
|
||||
}
|
||||
"apiIssue" in {
|
||||
JsonFormat(apiIssue) must beFormatted(apiIssueJson)
|
||||
JsonFormat(apiIssuePR) must beFormatted(apiIssuePRJson)
|
||||
|
||||
Reference in New Issue
Block a user