summaryrefslogtreecommitdiffstats
path: root/models/db/list_test.go
diff options
context:
space:
mode:
authorNick <nick.guenther@polymtl.ca>2023-03-08 20:24:23 -0500
committerGitHub <noreply@github.com>2023-03-09 09:24:23 +0800
commit52e24167e5ebe0297f7630e9daecd6ffc9570a99 (patch)
treec91c05503a8f71856ff36e11ee0b3d447ce4253c /models/db/list_test.go
parentc5573dbc0fe2937a363813971a443277ccd580c3 (diff)
downloadgitea-52e24167e5ebe0297f7630e9daecd6ffc9570a99.tar.gz
gitea-52e24167e5ebe0297f7630e9daecd6ffc9570a99.zip
Test renderReadmeFile (#23185)
Add test coverage to the important features of [`routers.web.repo.renderReadmeFile`](https://github.com/go-gitea/gitea/blob/067b0c2664d127c552ccdfd264257caca4907a77/routers/web/repo/view.go#L273); namely that: - it can handle looking in docs/, .gitea/, and .github/ - it can handle choosing between multiple competing READMEs - it prefers the localized README to the markdown README to the plaintext README - it can handle broken symlinks when processing all the options - it uses the name of the symlink, not the name of the target of the symlink
Diffstat (limited to 'models/db/list_test.go')
-rw-r--r--models/db/list_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/db/list_test.go b/models/db/list_test.go
index ffef1e4948..1295692cec 100644
--- a/models/db/list_test.go
+++ b/models/db/list_test.go
@@ -35,11 +35,11 @@ func TestFind(t *testing.T) {
var repoUnits []repo_model.RepoUnit
err := db.Find(db.DefaultContext, &opts, &repoUnits)
assert.NoError(t, err)
- assert.EqualValues(t, 83, len(repoUnits))
+ assert.EqualValues(t, 84, len(repoUnits))
cnt, err := db.Count(db.DefaultContext, &opts, new(repo_model.RepoUnit))
assert.NoError(t, err)
- assert.EqualValues(t, 83, cnt)
+ assert.EqualValues(t, 84, cnt)
repoUnits = make([]repo_model.RepoUnit, 0, 10)
newCnt, err := db.FindAndCount(db.DefaultContext, &opts, &repoUnits)