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.
32 lines
914 B
32 lines
914 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.
|
||
|
|
||
2 years ago
|
package integration
|
||
8 years ago
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
"testing"
|
||
|
|
||
3 years ago
|
repo_model "code.gitea.io/gitea/models/repo"
|
||
3 years ago
|
"code.gitea.io/gitea/models/unittest"
|
||
3 years ago
|
user_model "code.gitea.io/gitea/models/user"
|
||
2 years ago
|
"code.gitea.io/gitea/tests"
|
||
8 years ago
|
)
|
||
|
|
||
6 years ago
|
func TestEmptyRepo(t *testing.T) {
|
||
2 years ago
|
defer tests.PrepareTestEnv(t)()
|
||
8 years ago
|
subpaths := []string{
|
||
|
"commits/master",
|
||
|
"raw/foo",
|
||
|
"commit/1ae57b34ccf7e18373",
|
||
|
"graph",
|
||
|
}
|
||
2 years ago
|
emptyRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{}, unittest.Cond("is_empty = ?", true))
|
||
|
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: emptyRepo.OwnerID})
|
||
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)
|
||
|
}
|
||
|
}
|