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:
parent
0231760b60
commit
82f3e2d475
26
routers/web/admin/repos_test.go
Normal file
26
routers/web/admin/repos_test.go
Normal 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)
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user