diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2018-05-11 17:20:47 +0200 |
---|---|---|
committer | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-05-11 11:20:47 -0400 |
commit | 0dbaa2d032ae42cbf39945df12efb20fc572b559 (patch) | |
tree | f7562ffe4f32edd47b36849fd7b5c903d0075855 /app/apptestlib.go | |
parent | 21d3b247d9645efa9471877cc36b46de92dc1d09 (diff) | |
download | chat-0dbaa2d032ae42cbf39945df12efb20fc572b559.tar.gz chat-0dbaa2d032ae42cbf39945df12efb20fc572b559.tar.bz2 chat-0dbaa2d032ae42cbf39945df12efb20fc572b559.zip |
[MM-10458] Change system response to "Could not find the channel" - bug fix (#8738)
* [MM-10458] Change system response to "Could not find the channel" when trying to invite user to private channel you can't see
* add another check to check if user have permission to add another in pvt channel
Diffstat (limited to 'app/apptestlib.go')
-rw-r--r-- | app/apptestlib.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/apptestlib.go b/app/apptestlib.go index 626e932e8..b245ddabf 100644 --- a/app/apptestlib.go +++ b/app/apptestlib.go @@ -227,6 +227,29 @@ func (me *TestHelper) createChannel(team *model.Team, channelType string) *model return channel } +func (me *TestHelper) createChannelWithAnotherUser(team *model.Team, channelType, userId string) *model.Channel { + id := model.NewId() + + channel := &model.Channel{ + DisplayName: "dn_" + id, + Name: "name_" + id, + Type: channelType, + TeamId: team.Id, + CreatorId: userId, + } + + utils.DisableDebugLogForTest() + var err *model.AppError + if channel, err = me.App.CreateChannel(channel, true); err != nil { + mlog.Error(err.Error()) + + time.Sleep(time.Second) + panic(err) + } + utils.EnableDebugLogForTest() + return channel +} + func (me *TestHelper) CreateDmChannel(user *model.User) *model.Channel { utils.DisableDebugLogForTest() var err *model.AppError |