diff options
author | Evgeniy <gig177@yandex.ru> | 2018-01-19 00:05:00 +0300 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-01-18 16:05:00 -0500 |
commit | 9d6a9ff4be15f673e8364a984ccc2b2c3a465b73 (patch) | |
tree | 0450311827328cd0f68282a3491f66803634ea48 /app/channel_test.go | |
parent | e9a9262956bb948532e3d21604059f23cab85066 (diff) | |
download | chat-9d6a9ff4be15f673e8364a984ccc2b2c3a465b73.tar.gz chat-9d6a9ff4be15f673e8364a984ccc2b2c3a465b73.tar.bz2 chat-9d6a9ff4be15f673e8364a984ccc2b2c3a465b73.zip |
Post a system message to the affected channel by CLI command (#7877) (#7968)
Diffstat (limited to 'app/channel_test.go')
-rw-r--r-- | app/channel_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/channel_test.go b/app/channel_test.go index d44af467d..a414fbb35 100644 --- a/app/channel_test.go +++ b/app/channel_test.go @@ -190,6 +190,21 @@ func TestCreateChannelPrivate(t *testing.T) { assert.Equal(t, privateChannel.Id, histories[0].ChannelId) } +func TestUpdateChannelPrivacy(t *testing.T) { + th := Setup().InitBasic() + defer th.TearDown() + + privateChannel := th.createChannel(th.BasicTeam, model.CHANNEL_PRIVATE) + privateChannel.Type = model.CHANNEL_OPEN + + if publicChannel, err := th.App.UpdateChannelPrivacy(privateChannel, th.BasicUser); err != nil { + t.Fatal("Failed to update channel privacy. Error: " + err.Error()) + } else { + assert.Equal(t, publicChannel.Id, privateChannel.Id) + assert.Equal(t, publicChannel.Type, model.CHANNEL_OPEN) + } +} + func TestCreateGroupChannel(t *testing.T) { th := Setup().InitBasic() defer th.TearDown() |