summaryrefslogtreecommitdiffstats
path: root/api/oauth_test.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-11-21 13:08:32 -0600
committerChristopher Speller <crspeller@gmail.com>2017-11-21 11:08:32 -0800
commit816a30397da6ceff836d8723233dc5cdbda70871 (patch)
treed9075e04c6570296cea924b97088839f49d6ce9d /api/oauth_test.go
parent01e652ed481ed0ef0a8d8c021751655c1a58dd2a (diff)
downloadchat-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/oauth_test.go')
-rw-r--r--api/oauth_test.go16
1 files changed, 2 insertions, 14 deletions
diff --git a/api/oauth_test.go b/api/oauth_test.go
index 395eaade7..8309b67cc 100644
--- a/api/oauth_test.go
+++ b/api/oauth_test.go
@@ -89,12 +89,8 @@ func TestOAuthRegisterApp(t *testing.T) {
}
adminOnly := *th.App.Config().ServiceSettings.EnableOnlyAdminIntegrations
- defer func() {
- th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = adminOnly })
- utils.SetDefaultRolesBasedOnConfig()
- }()
+ defer th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = adminOnly })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = false })
- utils.SetDefaultRolesBasedOnConfig()
th.LoginBasic()
@@ -217,7 +213,6 @@ func TestOAuthGetAppsByUser(t *testing.T) {
}
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = false })
- utils.SetDefaultRolesBasedOnConfig()
if result, err := Client.GetOAuthAppsByUser(); err != nil {
t.Fatal(err)
@@ -445,7 +440,6 @@ func TestOAuthDeleteApp(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOAuthServiceProvider = true })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = false })
- utils.SetDefaultRolesBasedOnConfig()
oauthApp := &model.OAuthApp{Name: "TestApp5" + model.NewId(), Homepage: "https://nowhere.com", Description: "test", CallbackUrls: []string{"https://nowhere.com"}}
@@ -504,11 +498,9 @@ func TestOAuthAccessToken(t *testing.T) {
defer func() {
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOAuthServiceProvider = enableOAuth })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = adminOnly })
- utils.SetDefaultRolesBasedOnConfig()
}()
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOAuthServiceProvider = true })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = false })
- utils.SetDefaultRolesBasedOnConfig()
oauthApp := &model.OAuthApp{Name: "TestApp5" + model.NewId(), Homepage: "https://nowhere.com", Description: "test", CallbackUrls: []string{"https://nowhere.com"}}
oauthApp = Client.Must(Client.RegisterApp(oauthApp)).Data.(*model.OAuthApp)
@@ -751,12 +743,8 @@ func TestOAuthComplete(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOAuthServiceProvider = true })
adminOnly := *th.App.Config().ServiceSettings.EnableOnlyAdminIntegrations
- defer func() {
- th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = adminOnly })
- utils.SetDefaultRolesBasedOnConfig()
- }()
+ defer th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = adminOnly })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = false })
- utils.SetDefaultRolesBasedOnConfig()
oauthApp := &model.OAuthApp{
Name: "TestApp5" + model.NewId(),