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 705B

12345678910111213141516171819202122232425262728
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package repo
  5. import (
  6. "testing"
  7. "code.gitea.io/gitea/models"
  8. "code.gitea.io/gitea/modules/test"
  9. "github.com/stretchr/testify/assert"
  10. )
  11. func TestCheckProjectBoardChangePermissions(t *testing.T) {
  12. models.PrepareTestEnv(t)
  13. ctx := test.MockContext(t, "user2/repo1/projects/1/2")
  14. test.LoadUser(t, ctx, 2)
  15. test.LoadRepo(t, ctx, 1)
  16. ctx.SetParams(":id", "1")
  17. ctx.SetParams(":boardID", "2")
  18. project, board := checkProjectBoardChangePermissions(ctx)
  19. assert.NotNil(t, project)
  20. assert.NotNil(t, board)
  21. assert.False(t, ctx.Written())
  22. }