diff --git a/routers/web/admin/repos_test.go b/routers/web/admin/repos_test.go new file mode 100644 index 00000000000..dcfb1c7b38b --- /dev/null +++ b/routers/web/admin/repos_test.go @@ -0,0 +1,26 @@ +// Copyright 2019 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +package admin + +import ( + "testing" + + "code.gitea.io/gitea/models/unittest" + "code.gitea.io/gitea/modules/test" + + "github.com/stretchr/testify/assert" +) + +func TestUpdateRepoPost(t *testing.T) { + unittest.PrepareTestEnv(t) + ctx := test.MockContext(t, "admin/repos") + test.LoadUser(t, ctx, 1) + + ctx.Req.Form.Set("enable_size_limit", "on") + ctx.Req.Form.Set("repo_size_limit", "222 kcmcm") + + UpdateRepoPost(ctx) + + assert.NotEmpty(t, ctx.Flash.ErrorMsg) +}