mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-18 23:47:50 +00:00
chore(refactor): run routers/api/v1/permissions/tests from tests/integration (#13157)
Changing the tests introduced in [this pull request](https://codeberg.org/forgejo/forgejo/pulls/12512) to run from the integration directory instead of running from a package, makes it possible to backport to v15. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13157 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
This commit is contained in:
parent
0ab8cecc52
commit
65e35d2ba0
44 changed files with 202 additions and 207 deletions
28
tests/integration/apiv1_permissions_test.go
Normal file
28
tests/integration/apiv1_permissions_test.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2026 The Forgejo Authors.
|
||||
// SPDX-License-Identifier: GPLv3-or-later
|
||||
|
||||
package integration
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"forgejo.org/models/unittest"
|
||||
"forgejo.org/modules/setting"
|
||||
"forgejo.org/modules/test"
|
||||
apiv1 "forgejo.org/routers/api/v1"
|
||||
apiv1_permissions_tests "forgejo.org/routers/api/v1/permissions/tests"
|
||||
)
|
||||
|
||||
func TestAPIv1Permissions(t *testing.T) {
|
||||
defer test.MockVariableValue(&setting.Service.DefaultAllowCreateOrganization, true)()
|
||||
defer test.MockVariableValue(&setting.IsInTesting, true)()
|
||||
defer test.MockVariableValue(&setting.DisableGitHooks, false)()
|
||||
|
||||
unittest.PrepareTestEnv(t)
|
||||
|
||||
// because setting.IsInTesting == true, it will record the
|
||||
// middleware sequence of each route it builds
|
||||
apiv1.Routes()
|
||||
|
||||
apiv1_permissions_tests.APIv1Permissions(t)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue