summaryrefslogtreecommitdiffstats
path: root/app/apptestlib.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-04-20 08:44:18 -0400
committerGitHub <noreply@github.com>2018-04-20 08:44:18 -0400
commit283f34b9c6d207f0a103e7b4c7f6da2c7481c3ef (patch)
tree9a9d0dfb9f536d37e9817e3407c32e7ec0c11cdf /app/apptestlib.go
parent7987c95fcd7f7a9e6d4d174be403bf170f7b9115 (diff)
downloadchat-283f34b9c6d207f0a103e7b4c7f6da2c7481c3ef.tar.gz
chat-283f34b9c6d207f0a103e7b4c7f6da2c7481c3ef.tar.bz2
chat-283f34b9c6d207f0a103e7b4c7f6da2c7481c3ef.zip
MM-10007 Send an admin and regular WS events when a user is updated (#8588)
* Add user.DeepCopy() function * Add omit admins/non-admins to WS broadcast and use for updating users * Updates per feedback and adding unit test for ShouldSendEvent
Diffstat (limited to 'app/apptestlib.go')
-rw-r--r--app/apptestlib.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/apptestlib.go b/app/apptestlib.go
index 1b22831c9..a5c2db91c 100644
--- a/app/apptestlib.go
+++ b/app/apptestlib.go
@@ -31,6 +31,8 @@ type TestHelper struct {
BasicChannel *model.Channel
BasicPost *model.Post
+ SystemAdminUser *model.User
+
tempConfigPath string
tempWorkspace string
pluginHooks map[string]plugin.Hooks
@@ -143,6 +145,14 @@ func (me *TestHelper) InitBasic() *TestHelper {
return me
}
+func (me *TestHelper) InitSystemAdmin() *TestHelper {
+ me.SystemAdminUser = me.CreateUser()
+ me.App.UpdateUserRoles(me.SystemAdminUser.Id, model.SYSTEM_USER_ROLE_ID+" "+model.SYSTEM_ADMIN_ROLE_ID, false)
+ me.SystemAdminUser, _ = me.App.GetUser(me.SystemAdminUser.Id)
+
+ return me
+}
+
func (me *TestHelper) MakeEmail() string {
return "success_" + model.NewId() + "@simulator.amazonses.com"
}