1
0
Fork 0
forked from forgejo/forgejo

Do some missing checks (#28423)

(cherry picked from commit 717d0f5934)

Conflicts:
	routers/api/v1/api.go
	trivial contextual conflict
This commit is contained in:
Lunny Xiao 2023-12-12 13:01:17 +08:00 committed by Earl Warren
parent 5528072d04
commit 7aa1e1a54d
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 62 additions and 3 deletions

View file

@ -0,0 +1,23 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package integration
import (
"net/http"
"testing"
"code.gitea.io/gitea/tests"
)
func TestPrivateRepoProject(t *testing.T) {
defer tests.PrepareTestEnv(t)()
// not logged in user
req := NewRequest(t, "GET", "/user31/-/projects")
MakeRequest(t, req, http.StatusNotFound)
sess := loginUser(t, "user1")
req = NewRequest(t, "GET", "/user31/-/projects")
sess.MakeRequest(t, req, http.StatusOK)
}