diff --git a/app/authorization_test.go b/app/authorization_test.go index 0151985629..e8a32ebde6 100644 --- a/app/authorization_test.go +++ b/app/authorization_test.go @@ -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) } }