[MM-18323] Migrate tests from "app/authorization_test.go" to use testify (#12078)

* updated test case to use testify

* change test from require to assert

* Update app/authorization_test.go

Co-Authored-By: Jesús Espino <jespinog@gmail.com>
Этот коммит содержится в:
Phillip Ahereza
2019-09-09 14:43:17 +03:00
коммит произвёл Miguel de la Cruz
родитель 2b18ebe2cf
Коммит 8a27ec5749

Просмотреть файл

@@ -4,6 +4,7 @@
package app
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/mattermost/mattermost-server/model"
@@ -28,10 +29,8 @@ func TestCheckIfRolesGrantPermission(t *testing.T) {
{[]string{model.TEAM_ADMIN_ROLE_ID, model.TEAM_USER_ROLE_ID}, model.PERMISSION_MANAGE_SLASH_COMMANDS.Id, true},
}
for testnum, testcase := range cases {
if th.App.RolesGrantPermission(testcase.roles, testcase.permissionId) != testcase.shouldGrant {
t.Fatal("Failed test case ", testnum)
}
for _, testcase := range cases {
assert.Equal(t, th.App.RolesGrantPermission(testcase.roles, testcase.permissionId), testcase.shouldGrant)
}
}