diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-01-19 09:00:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-19 09:00:13 -0500 |
commit | d3a285e64d051aa8d5c4c9854597dfbcce107675 (patch) | |
tree | e16ca3d52b6347a754e506aa8cac7457c62d3639 /api/apitestlib.go | |
parent | 61b7226533568f3261fc233538ce998bb71a5345 (diff) | |
download | chat-d3a285e64d051aa8d5c4c9854597dfbcce107675.tar.gz chat-d3a285e64d051aa8d5c4c9854597dfbcce107675.tar.bz2 chat-d3a285e64d051aa8d5c4c9854597dfbcce107675.zip |
Migrate functions to app package (#5106)
* Refactor and move session logic into app package
* Refactor email functions into the app package
* Refactor password update into app package
* Migrate user functions to app package
* Move team functions into app package
* Migrate channel functions into app package
* Pass SiteURL through to app functions
* Update based on feedback
Diffstat (limited to 'api/apitestlib.go')
-rw-r--r-- | api/apitestlib.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/api/apitestlib.go b/api/apitestlib.go index abd4767b7..09aed0e33 100644 --- a/api/apitestlib.go +++ b/api/apitestlib.go @@ -99,7 +99,7 @@ func (me *TestHelper) InitSystemAdmin() *TestHelper { me.SystemAdminUser = me.CreateUser(me.SystemAdminClient) LinkUserToTeam(me.SystemAdminUser, me.SystemAdminTeam) me.SystemAdminClient.SetTeamId(me.SystemAdminTeam.Id) - UpdateUserRoles(me.SystemAdminUser, model.ROLE_SYSTEM_USER.Id+" "+model.ROLE_SYSTEM_ADMIN.Id) + app.UpdateUserRoles(me.SystemAdminUser.Id, model.ROLE_SYSTEM_USER.Id+" "+model.ROLE_SYSTEM_ADMIN.Id) me.SystemAdminUser.Password = "Password1" me.LoginSystemAdmin() me.SystemAdminChannel = me.CreateChannel(me.SystemAdminClient, me.SystemAdminTeam) @@ -180,9 +180,9 @@ func MakeUserChannelAdmin(user *model.User, channel *model.Channel) { utils.DisableDebugLogForTest() if cmr := <-app.Srv.Store.Channel().GetMember(channel.Id, user.Id); cmr.Err == nil { - cm := cmr.Data.(model.ChannelMember) + cm := cmr.Data.(*model.ChannelMember) cm.Roles = "channel_admin channel_user" - if sr := <-app.Srv.Store.Channel().UpdateMember(&cm); sr.Err != nil { + if sr := <-app.Srv.Store.Channel().UpdateMember(cm); sr.Err != nil { utils.EnableDebugLogForTest() panic(sr.Err) } @@ -198,9 +198,9 @@ func MakeUserChannelUser(user *model.User, channel *model.Channel) { utils.DisableDebugLogForTest() if cmr := <-app.Srv.Store.Channel().GetMember(channel.Id, user.Id); cmr.Err == nil { - cm := cmr.Data.(model.ChannelMember) + cm := cmr.Data.(*model.ChannelMember) cm.Roles = "channel_user" - if sr := <-app.Srv.Store.Channel().UpdateMember(&cm); sr.Err != nil { + if sr := <-app.Srv.Store.Channel().UpdateMember(cm); sr.Err != nil { utils.EnableDebugLogForTest() panic(sr.Err) } |