code.gitea.io/gitea@v1.21.7/tests/integration/api_fork_test.go (about) 1 // Copyright 2017 The Gogs Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package integration 5 6 import ( 7 "net/http" 8 "testing" 9 10 api "code.gitea.io/gitea/modules/structs" 11 "code.gitea.io/gitea/tests" 12 ) 13 14 func TestCreateForkNoLogin(t *testing.T) { 15 defer tests.PrepareTestEnv(t)() 16 req := NewRequestWithJSON(t, "POST", "/api/v1/repos/user2/repo1/forks", &api.CreateForkOption{}) 17 MakeRequest(t, req, http.StatusUnauthorized) 18 }