You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

projects_test.go 644B

123456789101112131415161718192021222324252627
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package repo
  4. import (
  5. "testing"
  6. "code.gitea.io/gitea/models/unittest"
  7. "code.gitea.io/gitea/modules/test"
  8. "github.com/stretchr/testify/assert"
  9. )
  10. func TestCheckProjectBoardChangePermissions(t *testing.T) {
  11. unittest.PrepareTestEnv(t)
  12. ctx := test.MockContext(t, "user2/repo1/projects/1/2")
  13. test.LoadUser(t, ctx, 2)
  14. test.LoadRepo(t, ctx, 1)
  15. ctx.SetParams(":id", "1")
  16. ctx.SetParams(":boardID", "2")
  17. project, board := checkProjectBoardChangePermissions(ctx)
  18. assert.NotNil(t, project)
  19. assert.NotNil(t, board)
  20. assert.False(t, ctx.Written())
  21. }