diff options
author | Balasankar C <balasankarc@users.noreply.github.com> | 2018-05-18 19:27:30 +0530 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2018-05-18 09:57:30 -0400 |
commit | d3ead7dc8535f8fa5b175686cc1f7669c8b1648b (patch) | |
tree | ad6e0294e908f71c28f5fed1372c09b972e803a5 /api4/user_test.go | |
parent | c6cbce610043bb050f2c542412eb439dc22c4a88 (diff) | |
download | chat-d3ead7dc8535f8fa5b175686cc1f7669c8b1648b.tar.gz chat-d3ead7dc8535f8fa5b175686cc1f7669c8b1648b.tar.bz2 chat-d3ead7dc8535f8fa5b175686cc1f7669c8b1648b.zip |
MM-10640 Set EnableUserCreation to true by default (#8815)
* Set EnableUserCreation to true by default
* Fix argument type to FormatBool
* Convert EnableUserCreation instances to pointer
* Convert to boolean in tests also
* Set value of pointer to be false
* Convert remaining EnableUserCreation instances to pointer
Diffstat (limited to 'api4/user_test.go')
-rw-r--r-- | api4/user_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/api4/user_test.go b/api4/user_test.go index 5b4d8890a..4851f139e 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -63,7 +63,7 @@ func TestCreateUser(t *testing.T) { CheckBadRequestStatus(t, resp) th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableOpenServer = false }) - th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.EnableUserCreation = false }) + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableUserCreation = false }) user2 := &model.User{Email: th.GenerateTestEmail(), Password: "Password1", Username: GenerateTestUsername()} _, resp = AdminClient.CreateUser(user2) @@ -170,13 +170,13 @@ func TestCreateUserWithToken(t *testing.T) { <-th.App.Srv.Store.Token().Save(token) defer th.App.DeleteToken(token) - th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.EnableUserCreation = false }) + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableUserCreation = false }) _, resp := Client.CreateUserWithToken(&user, token.Token) CheckNotImplementedStatus(t, resp) CheckErrorMessage(t, resp, "api.user.create_user.signup_email_disabled.app_error") - th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.EnableUserCreation = true }) + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableUserCreation = true }) }) t.Run("EnableOpenServerDisable", func(t *testing.T) { @@ -270,7 +270,7 @@ func TestCreateUserWithInviteId(t *testing.T) { t.Run("EnableUserCreationDisable", func(t *testing.T) { user := model.User{Email: th.GenerateTestEmail(), Nickname: "Corey Hulen", Password: "hello1", Username: GenerateTestUsername(), Roles: model.SYSTEM_ADMIN_ROLE_ID + " " + model.SYSTEM_USER_ROLE_ID} - th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.EnableUserCreation = false }) + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableUserCreation = false }) inviteId := th.BasicTeam.InviteId @@ -278,7 +278,7 @@ func TestCreateUserWithInviteId(t *testing.T) { CheckNotImplementedStatus(t, resp) CheckErrorMessage(t, resp, "api.user.create_user.signup_email_disabled.app_error") - th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.EnableUserCreation = true }) + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableUserCreation = true }) }) t.Run("EnableOpenServerDisable", func(t *testing.T) { |