Fix branch api canPush and canMerge (#10776)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
Lunny Xiao 2020-03-21 11:41:33 +08:00 committed by GitHub
parent b3f4f812d8
commit dcaa5643d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 25 deletions

View file

@ -28,6 +28,8 @@ func testAPIGetBranch(t *testing.T, branchName string, exists bool) {
var branch api.Branch
DecodeJSON(t, resp, &branch)
assert.EqualValues(t, branchName, branch.Name)
assert.True(t, branch.UserCanPush)
assert.True(t, branch.UserCanMerge)
}
func testAPIGetBranchProtection(t *testing.T, branchName string, expectedHTTPStatus int) {