From 0dbaa2d032ae42cbf39945df12efb20fc572b559 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Fri, 11 May 2018 17:20:47 +0200 Subject: [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 --- app/apptestlib.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'app/apptestlib.go') 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 -- cgit v1.2.3-1-g7c22