Add project board card move API
This commit is contained in:
@@ -51,6 +51,42 @@ func TestAPIListProjectBoards(t *testing.T) {
|
||||
assert.Len(t, apiProjectBoards, 4)
|
||||
}
|
||||
|
||||
func TestAPIMoveProjectBoardCard(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue)
|
||||
link, _ := url.Parse("/api/v1/projects/1/boards/2/cards/1/move")
|
||||
|
||||
req := NewRequest(t, "POST", link.String()).AddTokenAuth(token)
|
||||
MakeRequest(t, req, http.StatusNoContent)
|
||||
|
||||
projectIssue := unittest.AssertExistsAndLoadBean(t, &project_model.ProjectIssue{
|
||||
ProjectID: 1,
|
||||
IssueID: 1,
|
||||
})
|
||||
assert.EqualValues(t, 2, projectIssue.ProjectBoardID)
|
||||
}
|
||||
|
||||
func TestAPIMoveProjectBoardCardRejectsWrongProjectBoard(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue)
|
||||
link, _ := url.Parse("/api/v1/projects/1/boards/4/cards/1/move")
|
||||
|
||||
req := NewRequest(t, "POST", link.String()).AddTokenAuth(token)
|
||||
MakeRequest(t, req, http.StatusNotFound)
|
||||
}
|
||||
|
||||
func TestAPIMoveProjectBoardCardRejectsCardOutsideProject(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue)
|
||||
link, _ := url.Parse("/api/v1/projects/1/boards/2/cards/4/move")
|
||||
|
||||
req := NewRequest(t, "POST", link.String()).AddTokenAuth(token)
|
||||
MakeRequest(t, req, http.StatusNotFound)
|
||||
}
|
||||
|
||||
func TestAPIGetProjectBoard(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user