summaryrefslogtreecommitdiffstats
path: root/api4/channel_test.go
diff options
context:
space:
mode:
authorMartin Kraft <martinkraft@gmail.com>2018-05-09 15:00:07 -0400
committerMartin Kraft <martinkraft@gmail.com>2018-05-09 15:00:07 -0400
commitd3e14a1bf86ac6148e09f888384cb46c61f23cdc (patch)
tree1c634c90166964f5184cb1ebd20ffb8ed209b120 /api4/channel_test.go
parent60cf74352f13874a7d07c609c03b1c763af19cea (diff)
parentc1853c7f40dd67c49524c8ea884ab61883a6abdd (diff)
downloadchat-d3e14a1bf86ac6148e09f888384cb46c61f23cdc.tar.gz
chat-d3e14a1bf86ac6148e09f888384cb46c61f23cdc.tar.bz2
chat-d3e14a1bf86ac6148e09f888384cb46c61f23cdc.zip
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2
Diffstat (limited to 'api4/channel_test.go')
-rw-r--r--api4/channel_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/api4/channel_test.go b/api4/channel_test.go
index 7618b22d9..11d313291 100644
--- a/api4/channel_test.go
+++ b/api4/channel_test.go
@@ -915,10 +915,13 @@ func TestConvertChannelToPrivate(t *testing.T) {
CheckForbiddenStatus(t, resp)
th.LoginTeamAdmin()
- _, resp = Client.ConvertChannelToPrivate(publicChannel.Id)
- CheckForbiddenStatus(t, resp)
+ rchannel, resp := Client.ConvertChannelToPrivate(publicChannel.Id)
+ CheckOKStatus(t, resp)
+ if rchannel.Type != model.CHANNEL_PRIVATE {
+ t.Fatal("channel should be converted from public to private")
+ }
- rchannel, resp := th.SystemAdminClient.ConvertChannelToPrivate(privateChannel.Id)
+ rchannel, resp = th.SystemAdminClient.ConvertChannelToPrivate(privateChannel.Id)
CheckBadRequestStatus(t, resp)
if rchannel != nil {
t.Fatal("should not return a channel")
@@ -930,7 +933,8 @@ func TestConvertChannelToPrivate(t *testing.T) {
t.Fatal("should not return a channel")
}
- rchannel, resp = th.SystemAdminClient.ConvertChannelToPrivate(publicChannel.Id)
+ publicChannel2 := th.CreatePublicChannel()
+ rchannel, resp = th.SystemAdminClient.ConvertChannelToPrivate(publicChannel2.Id)
CheckOKStatus(t, resp)
if rchannel.Type != model.CHANNEL_PRIVATE {
t.Fatal("channel should be converted from public to private")