mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
Add assignee and assignees properties to some issues api payload (#2398)
This commit is contained in:
committed by
Naoki Takezoe
parent
c241c08904
commit
455183a13e
@@ -195,6 +195,15 @@ object ApiSpecModels {
|
||||
issue = issue,
|
||||
repositoryName = repo1Name,
|
||||
user = apiUser,
|
||||
assignee = Some(apiUser),
|
||||
labels = List(apiLabel)
|
||||
)
|
||||
|
||||
val apiNotAssignedIssue = ApiIssue(
|
||||
issue = issue,
|
||||
repositoryName = repo1Name,
|
||||
user = apiUser,
|
||||
assignee = None,
|
||||
labels = List(apiLabel)
|
||||
)
|
||||
|
||||
@@ -202,6 +211,7 @@ object ApiSpecModels {
|
||||
issue = issuePR,
|
||||
repositoryName = repo1Name,
|
||||
user = apiUser,
|
||||
assignee = Some(apiUser),
|
||||
labels = List(apiLabel)
|
||||
)
|
||||
|
||||
@@ -449,12 +459,29 @@ object ApiSpecModels {
|
||||
|"number":1347,
|
||||
|"title":"Found a bug",
|
||||
|"user":$jsonUser,
|
||||
|"assignee":$jsonUser,
|
||||
|"labels":[$jsonLabel],
|
||||
|"state":"open",
|
||||
|"created_at":"2011-04-14T16:00:49Z",
|
||||
|"updated_at":"2011-04-14T16:00:49Z",
|
||||
|"body":"I'm having a problem with this.",
|
||||
|"id":0,
|
||||
|"assignees":[$jsonUser],
|
||||
|"comments_url":"http://gitbucket.exmple.com/api/v3/repos/octocat/Hello-World/issues/1347/comments",
|
||||
|"html_url":"http://gitbucket.exmple.com/octocat/Hello-World/issues/1347"
|
||||
|}""".stripMargin
|
||||
|
||||
val jsonNotAssignedIssue = s"""{
|
||||
|"number":1347,
|
||||
|"title":"Found a bug",
|
||||
|"user":$jsonUser,
|
||||
|"labels":[$jsonLabel],
|
||||
|"state":"open",
|
||||
|"created_at":"2011-04-14T16:00:49Z",
|
||||
|"updated_at":"2011-04-14T16:00:49Z",
|
||||
|"body":"I'm having a problem with this.",
|
||||
|"id":0,
|
||||
|"assignees":[],
|
||||
|"comments_url":"http://gitbucket.exmple.com/api/v3/repos/octocat/Hello-World/issues/1347/comments",
|
||||
|"html_url":"http://gitbucket.exmple.com/octocat/Hello-World/issues/1347"
|
||||
|}""".stripMargin
|
||||
@@ -463,12 +490,14 @@ object ApiSpecModels {
|
||||
|"number":1347,
|
||||
|"title":"new-feature",
|
||||
|"user":$jsonUser,
|
||||
|"assignee":$jsonUser,
|
||||
|"labels":[$jsonLabel],
|
||||
|"state":"closed",
|
||||
|"created_at":"2011-04-14T16:00:49Z",
|
||||
|"updated_at":"2011-04-14T16:00:49Z",
|
||||
|"body":"Please pull these awesome changes",
|
||||
|"id":0,
|
||||
|"assignees":[$jsonUser],
|
||||
|"comments_url":"http://gitbucket.exmple.com/api/v3/repos/octocat/Hello-World/issues/1347/comments",
|
||||
|"html_url":"http://gitbucket.exmple.com/octocat/Hello-World/pull/1347",
|
||||
|"pull_request":{
|
||||
|
||||
@@ -34,6 +34,7 @@ class JsonFormatSpec extends FunSuite {
|
||||
}
|
||||
test("apiIssue") {
|
||||
assert(JsonFormat(apiIssue) == expected(jsonIssue))
|
||||
assert(JsonFormat(apiNotAssignedIssue) == expected(jsonNotAssignedIssue))
|
||||
assert(JsonFormat(apiIssuePR) == expected(jsonIssuePR))
|
||||
}
|
||||
test("apiPullRequest") {
|
||||
|
||||
@@ -118,6 +118,7 @@ class WebHookJsonFormatSpec extends FunSuite {
|
||||
commentUser = account,
|
||||
repository = repositoryInfo,
|
||||
repositoryUser = account,
|
||||
assignedUser = Some(account),
|
||||
sender = account,
|
||||
labels = List(label)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user