summaryrefslogtreecommitdiffstats
path: root/api4/channel_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-03-23 18:37:39 -0400
committerCorey Hulen <corey@hulen.com>2017-03-23 15:37:39 -0700
commit42c3ea64a9e2e75193d35939bbca34adfbd5ddf9 (patch)
treeef6edcd96243ef35f8585206f61426fa1eb2b9fd /api4/channel_test.go
parent37c41a26c97e0a2fda80998fbb3594fa03b6b6dc (diff)
downloadchat-42c3ea64a9e2e75193d35939bbca34adfbd5ddf9.tar.gz
chat-42c3ea64a9e2e75193d35939bbca34adfbd5ddf9.tar.bz2
chat-42c3ea64a9e2e75193d35939bbca34adfbd5ddf9.zip
Fix delete channel test (#5863)
Diffstat (limited to 'api4/channel_test.go')
-rw-r--r--api4/channel_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/api4/channel_test.go b/api4/channel_test.go
index 987678ee0..ef0d35e4b 100644
--- a/api4/channel_test.go
+++ b/api4/channel_test.go
@@ -583,6 +583,9 @@ func TestDeleteChannel(t *testing.T) {
// successful delete by team admin
UpdateUserToTeamAdmin(user, team)
app.InvalidateAllCaches()
+ utils.IsLicensed = true
+ utils.License = &model.License{Features: &model.Features{}}
+ utils.License.Features.SetDefaults()
_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckNoError(t, resp)
@@ -595,6 +598,9 @@ func TestDeleteChannel(t *testing.T) {
utils.SetDefaultRolesBasedOnConfig()
UpdateUserToNonTeamAdmin(user, team)
app.InvalidateAllCaches()
+ utils.IsLicensed = true
+ utils.License = &model.License{Features: &model.Features{}}
+ utils.License.Features.SetDefaults()
// channels created by SystemAdmin
publicChannel6 = th.CreateChannelWithClient(th.SystemAdminClient, model.CHANNEL_OPEN)
@@ -623,6 +629,9 @@ func TestDeleteChannel(t *testing.T) {
// successful delete by team admin
UpdateUserToTeamAdmin(th.BasicUser, team)
app.InvalidateAllCaches()
+ utils.IsLicensed = true
+ utils.License = &model.License{Features: &model.Features{}}
+ utils.License.Features.SetDefaults()
_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckNoError(t, resp)
@@ -661,6 +670,9 @@ func TestDeleteChannel(t *testing.T) {
// cannot delete by team admin
UpdateUserToTeamAdmin(th.BasicUser, team)
app.InvalidateAllCaches()
+ utils.IsLicensed = true
+ utils.License = &model.License{Features: &model.Features{}}
+ utils.License.Features.SetDefaults()
_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckForbiddenStatus(t, resp)