mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Approvals at Branch Protection (#5350)
* Add branch protection for approvals Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add required approvals Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add missing comments and fmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add type = approval and group by reviewer_id to review * Prevent users from adding negative review limits * Add migration for approval whitelists Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
@@ -346,3 +346,17 @@ func TestHasTeamRepo(t *testing.T) {
|
||||
test(2, 3, true)
|
||||
test(2, 5, false)
|
||||
}
|
||||
|
||||
func TestUsersInTeamsCount(t *testing.T) {
|
||||
assert.NoError(t, PrepareTestDatabase())
|
||||
|
||||
test := func(teamIDs []int64, userIDs []int64, expected int64) {
|
||||
count, err := UsersInTeamsCount(teamIDs, userIDs)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, expected, count)
|
||||
}
|
||||
|
||||
test([]int64{2}, []int64{1, 2, 3, 4}, 2)
|
||||
test([]int64{1, 2, 3, 4, 5}, []int64{2, 5}, 2)
|
||||
test([]int64{1, 2, 3, 4, 5}, []int64{2, 3, 5}, 3)
|
||||
}
|
||||
|
Reference in New Issue
Block a user