[MM-42400] Prevent making groups with reserved names (#21040)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9da1f1ce43
Коммит
aee1600d49
@@ -154,6 +154,16 @@ func TestCreateGroup(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
CheckBadRequestStatus(t, response)
|
||||
|
||||
reservedNameGroup := &model.Group{
|
||||
DisplayName: "dn_" + model.NewId(),
|
||||
Name: model.NewString("here"),
|
||||
Source: model.GroupSourceCustom,
|
||||
AllowReference: true,
|
||||
}
|
||||
_, response, err = th.SystemAdminClient.CreateGroup(reservedNameGroup)
|
||||
require.Error(t, err)
|
||||
CheckBadRequestStatus(t, response)
|
||||
|
||||
th.SystemAdminClient.Logout()
|
||||
_, response, err = th.SystemAdminClient.CreateGroup(g)
|
||||
require.Error(t, err)
|
||||
@@ -294,6 +304,12 @@ func TestPatchGroup(t *testing.T) {
|
||||
CheckOKStatus(t, response)
|
||||
require.Equal(t, true, patchedG2.AllowReference)
|
||||
|
||||
_, response, err = th.SystemAdminClient.PatchGroup(g2.Id, &model.GroupPatch{
|
||||
Name: model.NewString("here"),
|
||||
})
|
||||
require.Error(t, err)
|
||||
CheckBadRequestStatus(t, response)
|
||||
|
||||
th.SystemAdminClient.Logout()
|
||||
_, response, err = th.SystemAdminClient.PatchGroup(group.Id, gp)
|
||||
require.Error(t, err)
|
||||
|
||||
Ссылка в новой задаче
Block a user