From 11cbb597471127c1b29e78e6cad0a1a4d93ea24c Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 17 May 2018 12:40:40 -0700 Subject: Renaming platform binary to mattermost. (#8801) --- cmd/mattermost/commands/roles_test.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 cmd/mattermost/commands/roles_test.go (limited to 'cmd/mattermost/commands/roles_test.go') diff --git a/cmd/mattermost/commands/roles_test.go b/cmd/mattermost/commands/roles_test.go new file mode 100644 index 000000000..0144bf0df --- /dev/null +++ b/cmd/mattermost/commands/roles_test.go @@ -0,0 +1,27 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package commands + +import ( + "testing" + + "github.com/mattermost/mattermost-server/api4" + "github.com/mattermost/mattermost-server/model" +) + +func TestAssignRole(t *testing.T) { + th := api4.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() + } + } +} -- cgit v1.2.3-1-g7c22