0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-06-12 22:14:48 +02:00

add test for global repo size limit option

This commit is contained in:
truecode112 2023-05-15 12:27:22 +03:00 committed by DmitryFrolovTri
parent 0231760b60
commit 82f3e2d475

View File

@ -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)
}