mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-23 17:36:41 +02:00
add test for global repo size limit option
This commit is contained in:
committed by
DmitryFrolovTri
parent
0231760b60
commit
82f3e2d475
@@ -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)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user