diff options
author | zeripath <art27@cantab.net> | 2019-01-18 00:01:04 +0000 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2019-01-17 19:01:04 -0500 |
commit | 07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8 (patch) | |
tree | 87ced90635366b09e7e5f2634acfe2cbec2bc9f6 /integrations/empty_repo_test.go | |
parent | 9edc829c1758b436f8f52ebe61479af087940d60 (diff) | |
download | gitea-07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8.tar.gz gitea-07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8.zip |
Refactor repo.isBare to repo.isEmpty #5629 (#5714)
* Refactor repo.isBare to repo.isEmpty #5629
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove Sync call
Diffstat (limited to 'integrations/empty_repo_test.go')
-rw-r--r-- | integrations/empty_repo_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/integrations/empty_repo_test.go b/integrations/empty_repo_test.go new file mode 100644 index 0000000000..2d72546e7d --- /dev/null +++ b/integrations/empty_repo_test.go @@ -0,0 +1,28 @@ +// 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" +) + +func TestEmptyRepo(t *testing.T) { + prepareTestEnv(t) + subpaths := []string{ + "commits/master", + "raw/foo", + "commit/1ae57b34ccf7e18373", + "graph", + } + emptyRepo := models.AssertExistsAndLoadBean(t, &models.Repository{}, models.Cond("is_empty = ?", true)).(*models.Repository) + owner := models.AssertExistsAndLoadBean(t, &models.User{ID: emptyRepo.OwnerID}).(*models.User) + for _, subpath := range subpaths { + req := NewRequestf(t, "GET", "/%s/%s/%s", owner.Name, emptyRepo.Name, subpath) + MakeRequest(t, req, http.StatusNotFound) + } +} |