diff options
author | George Goldberg <george@gberg.me> | 2017-03-23 17:38:24 +0000 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-03-23 17:38:24 +0000 |
commit | c6ded1dbfd69a1da69add8d2b554f4b7dd0341b3 (patch) | |
tree | a417d54a58edd244edb03935705618737cf2cf13 /api4/channel_test.go | |
parent | 120f5a6f8a5f4ab05aace89ae710698cf68d0564 (diff) | |
parent | 8ec37570742b67fd640bb3434ea226c655dbf408 (diff) | |
download | chat-c6ded1dbfd69a1da69add8d2b554f4b7dd0341b3.tar.gz chat-c6ded1dbfd69a1da69add8d2b554f4b7dd0341b3.tar.bz2 chat-c6ded1dbfd69a1da69add8d2b554f4b7dd0341b3.zip |
Merge branch 'release-3.7'
Diffstat (limited to 'api4/channel_test.go')
-rw-r--r-- | api4/channel_test.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/api4/channel_test.go b/api4/channel_test.go index e8e79cebd..987678ee0 100644 --- a/api4/channel_test.go +++ b/api4/channel_test.go @@ -92,10 +92,10 @@ func TestCreateChannel(t *testing.T) { }() *utils.Cfg.TeamSettings.RestrictPublicChannelCreation = model.PERMISSIONS_ALL *utils.Cfg.TeamSettings.RestrictPrivateChannelCreation = model.PERMISSIONS_ALL - utils.SetDefaultRolesBasedOnConfig() utils.IsLicensed = true utils.License = &model.License{Features: &model.Features{}} utils.License.Features.SetDefaults() + utils.SetDefaultRolesBasedOnConfig() channel.Name = GenerateTestChannelName() _, resp = Client.CreateChannel(channel) @@ -161,6 +161,19 @@ func TestCreateChannel(t *testing.T) { _, resp = th.SystemAdminClient.CreateChannel(private) CheckNoError(t, resp) + // Check that if unlicensed the policy restriction is not enforced. + utils.IsLicensed = false + utils.License = nil + utils.SetDefaultRolesBasedOnConfig() + + channel.Name = GenerateTestChannelName() + _, resp = Client.CreateChannel(channel) + CheckNoError(t, resp) + + private.Name = GenerateTestChannelName() + _, resp = Client.CreateChannel(private) + CheckNoError(t, resp) + if r, err := Client.DoApiPost("/channels", "garbage"); err == nil { t.Fatal("should have errored") } else { |