summaryrefslogtreecommitdiffstats
path: root/api4/scheme_test.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-05-17 16:29:31 +0100
committerGitHub <noreply@github.com>2018-05-17 16:29:31 +0100
commit463065c8ba4b4aece7fd9b7764ba917df3e73292 (patch)
tree2dfbe1dee29ce78eac853f64dde247338d44c917 /api4/scheme_test.go
parenta09dc68e1d99394f5d636284e0580dd17b2773b3 (diff)
downloadchat-463065c8ba4b4aece7fd9b7764ba917df3e73292.tar.gz
chat-463065c8ba4b4aece7fd9b7764ba917df3e73292.tar.bz2
chat-463065c8ba4b4aece7fd9b7764ba917df3e73292.zip
MM-10606: License feature flag for custom schemes. (#8804)
* MM-10606: Add new field to license for custom schemes. * Add feature flag to license check for Schemes.
Diffstat (limited to 'api4/scheme_test.go')
-rw-r--r--api4/scheme_test.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/api4/scheme_test.go b/api4/scheme_test.go
index 16c87cfac..9e5ed1aca 100644
--- a/api4/scheme_test.go
+++ b/api4/scheme_test.go
@@ -16,7 +16,7 @@ func TestCreateScheme(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer th.TearDown()
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
// Mark the migration as done.
<-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2)
@@ -124,7 +124,7 @@ func TestCreateScheme(t *testing.T) {
assert.Nil(t, res.Err)
th.LoginSystemAdmin()
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
scheme7 := &model.Scheme{
Name: model.NewId(),
@@ -139,7 +139,7 @@ func TestGetScheme(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer th.TearDown()
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
// Basic test of creating a team scheme.
scheme1 := &model.Scheme{
@@ -201,7 +201,7 @@ func TestGetSchemes(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer th.TearDown()
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
scheme1 := &model.Scheme{
Name: model.NewId(),
@@ -266,7 +266,7 @@ func TestGetTeamsForScheme(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer th.TearDown()
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
<-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2)
res := <-th.App.Srv.Store.System().Save(&model.System{Name: model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2, Value: "true"})
@@ -363,7 +363,7 @@ func TestGetChannelsForScheme(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer th.TearDown()
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
<-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2)
res := <-th.App.Srv.Store.System().Save(&model.System{Name: model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2, Value: "true"})
@@ -462,7 +462,7 @@ func TestPatchScheme(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer th.TearDown()
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
// Mark the migration as done.
<-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2)
@@ -555,7 +555,7 @@ func TestPatchScheme(t *testing.T) {
assert.Nil(t, res.Err)
th.LoginSystemAdmin()
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
_, r12 := th.SystemAdminClient.PatchScheme(s6.Id, schemePatch)
CheckNotImplementedStatus(t, r12)
@@ -566,7 +566,7 @@ func TestDeleteScheme(t *testing.T) {
defer th.TearDown()
t.Run("ValidTeamScheme", func(t *testing.T) {
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
// Mark the migration as done.
<-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2)
@@ -641,7 +641,7 @@ func TestDeleteScheme(t *testing.T) {
})
t.Run("ValidChannelScheme", func(t *testing.T) {
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
// Mark the migration as done.
<-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2)
@@ -704,7 +704,7 @@ func TestDeleteScheme(t *testing.T) {
})
t.Run("FailureCases", func(t *testing.T) {
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
// Mark the migration as done.
<-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2)
@@ -741,7 +741,7 @@ func TestDeleteScheme(t *testing.T) {
res = <-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2)
assert.Nil(t, res.Err)
- th.App.SetLicense(model.NewTestLicense(""))
+ th.App.SetLicense(model.NewTestLicense("custom_permissions_schemes"))
_, r6 := th.SystemAdminClient.DeleteScheme(s1.Id)
CheckNotImplementedStatus(t, r6)