diff --git a/models/git/branches_test.go b/models/git/branches_test.go index 58c4ad027b..04d67836c3 100644 --- a/models/git/branches_test.go +++ b/models/git/branches_test.go @@ -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", }) } diff --git a/models/git/protected_branch_test.go b/models/git/protected_branch_test.go index e1d1c211c4..bd178ef092 100644 --- a/models/git/protected_branch_test.go +++ b/models/git/protected_branch_test.go @@ -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" diff --git a/tests/integration/editor_test.go b/tests/integration/editor_test.go index 08d0021873..4b4314f809 100644 --- a/tests/integration/editor_test.go +++ b/tests/integration/editor_test.go @@ -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" )