Improve test coverage reporting / accuracy (#7819)
* improve test coverage reporting / accuracy * handle absolute coverpaths * move tests into multiple files * rename codecov.yml (https://github.com/codecov/support/issues/426)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
1329aa51b6
Коммит
865f9f83a7
27
cmd/platform/roles_test.go
Обычный файл
27
cmd/platform/roles_test.go
Обычный файл
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/mattermost-server/api"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
)
|
||||
|
||||
func TestAssignRole(t *testing.T) {
|
||||
th := api.Setup().InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
checkCommand(t, "roles", "system_admin", th.BasicUser.Email)
|
||||
|
||||
if result := <-th.App.Srv.Store.User().GetByEmail(th.BasicUser.Email); result.Err != nil {
|
||||
t.Fatal()
|
||||
} else {
|
||||
user := result.Data.(*model.User)
|
||||
if user.Roles != "system_admin system_user" {
|
||||
t.Fatal()
|
||||
}
|
||||
}
|
||||
}
|
||||
Ссылка в новой задаче
Block a user