diff options
author | Chris <ccbrown112@gmail.com> | 2017-11-21 13:08:32 -0600 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-11-21 11:08:32 -0800 |
commit | 816a30397da6ceff836d8723233dc5cdbda70871 (patch) | |
tree | d9075e04c6570296cea924b97088839f49d6ce9d /api/post_test.go | |
parent | 01e652ed481ed0ef0a8d8c021751655c1a58dd2a (diff) | |
download | chat-816a30397da6ceff836d8723233dc5cdbda70871.tar.gz chat-816a30397da6ceff836d8723233dc5cdbda70871.tar.bz2 chat-816a30397da6ceff836d8723233dc5cdbda70871.zip |
Role refactor (#7867)
* role refactor
* add missing file
* fix web test
Diffstat (limited to 'api/post_test.go')
-rw-r--r-- | api/post_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/api/post_test.go b/api/post_test.go index cb6b2bfb2..299fdf046 100644 --- a/api/post_test.go +++ b/api/post_test.go @@ -167,10 +167,10 @@ func TestCreatePost(t *testing.T) { th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.ExperimentalTownSquareIsReadOnly = disableTownSquareReadOnly }) utils.SetIsLicensed(isLicensed) utils.SetLicense(license) - utils.SetDefaultRolesBasedOnConfig() + th.App.SetDefaultRolesBasedOnConfig() }() th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.ExperimentalTownSquareIsReadOnly = true }) - utils.SetDefaultRolesBasedOnConfig() + th.App.SetDefaultRolesBasedOnConfig() utils.SetIsLicensed(true) utils.SetLicense(&model.License{Features: &model.Features{}}) utils.License().Features.SetDefaults() @@ -966,7 +966,7 @@ func TestDeletePosts(t *testing.T) { team1 := th.BasicTeam th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.RestrictPostDelete = model.PERMISSIONS_DELETE_POST_ALL }) - utils.SetDefaultRolesBasedOnConfig() + th.App.SetDefaultRolesBasedOnConfig() time.Sleep(10 * time.Millisecond) post1 := &model.Post{ChannelId: channel1.Id, Message: "zz" + model.NewId() + "a"} @@ -1044,7 +1044,7 @@ func TestDeletePosts(t *testing.T) { th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.RestrictPostDelete = model.PERMISSIONS_DELETE_POST_TEAM_ADMIN }) - utils.SetDefaultRolesBasedOnConfig() + th.App.SetDefaultRolesBasedOnConfig() th.LoginBasic() @@ -1069,7 +1069,7 @@ func TestDeletePosts(t *testing.T) { th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.RestrictPostDelete = model.PERMISSIONS_DELETE_POST_SYSTEM_ADMIN }) - utils.SetDefaultRolesBasedOnConfig() + th.App.SetDefaultRolesBasedOnConfig() th.LoginBasic() @@ -1090,7 +1090,7 @@ func TestDeletePosts(t *testing.T) { // Check that if unlicensed the policy restriction is not enforced. utils.SetIsLicensed(false) utils.SetLicense(nil) - utils.SetDefaultRolesBasedOnConfig() + th.App.SetDefaultRolesBasedOnConfig() time.Sleep(10 * time.Millisecond) post7 := &model.Post{ChannelId: channel1.Id, Message: "zz" + model.NewId() + "a"} |