mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-18 19:27:35 +00:00
refactor: update the board type enums
This commit is contained in:
parent
185a594d32
commit
30027ac0bd
@ -20,7 +20,7 @@ import (
|
|||||||
|
|
||||||
func TestAPICreateUserProject(t *testing.T) {
|
func TestAPICreateUserProject(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
const title, description, boardType = "project_name", "project_description", uint8(project_model.BoardTypeBasicKanban)
|
const title, description, boardType = "project_name", "project_description", uint8(project_model.TemplateTypeBasicKanban)
|
||||||
|
|
||||||
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue, auth_model.AccessTokenScopeWriteUser)
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue, auth_model.AccessTokenScopeWriteUser)
|
||||||
|
|
||||||
@ -34,13 +34,13 @@ func TestAPICreateUserProject(t *testing.T) {
|
|||||||
DecodeJSON(t, resp, &apiProject)
|
DecodeJSON(t, resp, &apiProject)
|
||||||
assert.Equal(t, title, apiProject.Title)
|
assert.Equal(t, title, apiProject.Title)
|
||||||
assert.Equal(t, description, apiProject.Description)
|
assert.Equal(t, description, apiProject.Description)
|
||||||
assert.Equal(t, boardType, apiProject.BoardType)
|
assert.Equal(t, boardType, apiProject.TemplateType)
|
||||||
assert.Equal(t, "user2", apiProject.Creator.UserName)
|
assert.Equal(t, "user2", apiProject.Creator.UserName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAPICreateOrgProject(t *testing.T) {
|
func TestAPICreateOrgProject(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
const title, description, boardType = "project_name", "project_description", uint8(project_model.BoardTypeBasicKanban)
|
const title, description, boardType = "project_name", "project_description", uint8(project_model.TemplateTypeBasicKanban)
|
||||||
|
|
||||||
orgName := "org17"
|
orgName := "org17"
|
||||||
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue, auth_model.AccessTokenScopeWriteOrganization)
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue, auth_model.AccessTokenScopeWriteOrganization)
|
||||||
@ -56,14 +56,14 @@ func TestAPICreateOrgProject(t *testing.T) {
|
|||||||
DecodeJSON(t, resp, &apiProject)
|
DecodeJSON(t, resp, &apiProject)
|
||||||
assert.Equal(t, title, apiProject.Title)
|
assert.Equal(t, title, apiProject.Title)
|
||||||
assert.Equal(t, description, apiProject.Description)
|
assert.Equal(t, description, apiProject.Description)
|
||||||
assert.Equal(t, boardType, apiProject.BoardType)
|
assert.Equal(t, boardType, apiProject.TemplateType)
|
||||||
assert.Equal(t, "user2", apiProject.Creator.UserName)
|
assert.Equal(t, "user2", apiProject.Creator.UserName)
|
||||||
assert.Equal(t, "org17", apiProject.Owner.UserName)
|
assert.Equal(t, "org17", apiProject.Owner.UserName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAPICreateRepoProject(t *testing.T) {
|
func TestAPICreateRepoProject(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
const title, description, boardType = "project_name", "project_description", uint8(project_model.BoardTypeBasicKanban)
|
const title, description, boardType = "project_name", "project_description", uint8(project_model.TemplateTypeBasicKanban)
|
||||||
|
|
||||||
ownerName := "user2"
|
ownerName := "user2"
|
||||||
repoName := "repo1"
|
repoName := "repo1"
|
||||||
@ -80,7 +80,7 @@ func TestAPICreateRepoProject(t *testing.T) {
|
|||||||
DecodeJSON(t, resp, &apiProject)
|
DecodeJSON(t, resp, &apiProject)
|
||||||
assert.Equal(t, title, apiProject.Title)
|
assert.Equal(t, title, apiProject.Title)
|
||||||
assert.Equal(t, description, apiProject.Description)
|
assert.Equal(t, description, apiProject.Description)
|
||||||
assert.Equal(t, boardType, apiProject.BoardType)
|
assert.Equal(t, boardType, apiProject.TemplateType)
|
||||||
assert.Equal(t, "repo1", apiProject.Repo.Name)
|
assert.Equal(t, "repo1", apiProject.Repo.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user