Add assignee and assignees properties to some issues api payload (#2398)

This commit is contained in:
Aoi Tanaka
2019-12-10 10:43:22 +09:00
committed by Naoki Takezoe
parent c241c08904
commit 455183a13e
7 changed files with 62 additions and 10 deletions

View File

@@ -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":{

View File

@@ -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") {

View File

@@ -118,6 +118,7 @@ class WebHookJsonFormatSpec extends FunSuite {
commentUser = account,
repository = repositoryInfo,
repositoryUser = account,
assignedUser = Some(account),
sender = account,
labels = List(label)
)