This commit is contained in:
Lunny Xiao 2022-10-22 20:50:17 +08:00
parent 3425685a81
commit 17a7982ad5
No known key found for this signature in database
GPG key ID: C3B7C91B632F738A
3 changed files with 7 additions and 6 deletions

View file

@ -106,8 +106,8 @@ func TestRenameBranch(t *testing.T) {
defer committer.Close()
assert.NoError(t, err)
assert.NoError(t, git_model.UpdateProtectBranch(ctx, repo1, &git_model.ProtectedBranch{
RepoID: repo1.ID,
BranchName: "master",
RepoID: repo1.ID,
RuleName: "master",
}, git_model.WhitelistOptions{}))
assert.NoError(t, committer.Commit())
@ -132,8 +132,8 @@ func TestRenameBranch(t *testing.T) {
assert.Equal(t, int64(1), renamedBranch.RepoID)
unittest.AssertExistsAndLoadBean(t, &git_model.ProtectedBranch{
RepoID: repo1.ID,
BranchName: "main",
RepoID: repo1.ID,
RuleName: "main",
})
}

View file

@ -55,7 +55,7 @@ func TestBranchRuleMatch(t *testing.T) {
}
for _, kase := range kases {
pb := ProtectedBranch{BranchName: kase.Rule}
pb := ProtectedBranch{RuleName: kase.Rule}
var should, infact string
if !kase.ExpectedMatch {
should = " not"

View file

@ -5,13 +5,14 @@
package integration
import (
"encoding/json"
"net/http"
"net/http/httptest"
"net/url"
"path"
"testing"
"code.gitea.io/gitea/modules/json"
"github.com/stretchr/testify/assert"
)