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.
29 lines
793 B
29 lines
793 B
8 years ago
|
// Copyright 2017 The Gitea Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
package integrations
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
"testing"
|
||
|
|
||
|
"code.gitea.io/gitea/models"
|
||
|
)
|
||
|
|
||
6 years ago
|
func TestEmptyRepo(t *testing.T) {
|
||
8 years ago
|
prepareTestEnv(t)
|
||
|
subpaths := []string{
|
||
|
"commits/master",
|
||
|
"raw/foo",
|
||
|
"commit/1ae57b34ccf7e18373",
|
||
|
"graph",
|
||
|
}
|
||
6 years ago
|
emptyRepo := models.AssertExistsAndLoadBean(t, &models.Repository{}, models.Cond("is_empty = ?", true)).(*models.Repository)
|
||
|
owner := models.AssertExistsAndLoadBean(t, &models.User{ID: emptyRepo.OwnerID}).(*models.User)
|
||
8 years ago
|
for _, subpath := range subpaths {
|
||
6 years ago
|
req := NewRequestf(t, "GET", "/%s/%s/%s", owner.Name, emptyRepo.Name, subpath)
|
||
8 years ago
|
MakeRequest(t, req, http.StatusNotFound)
|
||
|
}
|
||
|
}
|