From 8a27ec5749f7c27f902939eaf865ebe81ac2ddc7 Mon Sep 17 00:00:00 2001 From: Phillip Ahereza Date: Mon, 9 Sep 2019 14:43:17 +0300 Subject: [PATCH] [MM-18323] Migrate tests from "app/authorization_test.go" to use testify (#12078) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * updated test case to use testify * change test from require to assert * Update app/authorization_test.go Co-Authored-By: Jesús Espino --- app/authorization_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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) } }