diff options
author | George Goldberg <george@gberg.me> | 2018-02-13 13:35:52 +0000 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2018-02-13 13:46:01 +0000 |
commit | 5c101253c5987743cf1b3a8fe68814d748070622 (patch) | |
tree | e2632505d051e7d15d6daf974ed8ac92095f82fe /api/webhook_test.go | |
parent | b7fc3d7d35ca4dd16097715a66463392a1dfaf0a (diff) | |
parent | d88d2bc2ed3aefa68b5ed2942f493ae42bb40bfa (diff) | |
download | chat-5c101253c5987743cf1b3a8fe68814d748070622.tar.gz chat-5c101253c5987743cf1b3a8fe68814d748070622.tar.bz2 chat-5c101253c5987743cf1b3a8fe68814d748070622.zip |
Merge branch 'master' into advanced-permissions-phase-1
Diffstat (limited to 'api/webhook_test.go')
-rw-r--r-- | api/webhook_test.go | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/api/webhook_test.go b/api/webhook_test.go index b6b754ad3..0b3073f83 100644 --- a/api/webhook_test.go +++ b/api/webhook_test.go @@ -9,7 +9,6 @@ import ( "testing" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func TestCreateIncomingHook(t *testing.T) { @@ -980,10 +979,6 @@ func TestIncomingWebhooks(t *testing.T) { user2 := th.CreateUser(Client) th.LinkUserToTeam(user2, team) - enableIncomingHooks := th.App.Config().ServiceSettings.EnableIncomingWebhooks - defer func() { - th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableIncomingWebhooks = enableIncomingHooks }) - }() th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableIncomingWebhooks = true }) hook := &model.IncomingWebhook{ChannelId: channel1.Id} @@ -1025,18 +1020,8 @@ func TestIncomingWebhooks(t *testing.T) { t.Fatal("should not have failed -- ExperimentalTownSquareIsReadOnly is false and it's not a read only channel") } - isLicensed := utils.IsLicensed() - license := utils.License() - disableTownSquareReadOnly := th.App.Config().TeamSettings.ExperimentalTownSquareIsReadOnly - defer func() { - th.App.UpdateConfig(func(cfg *model.Config) { cfg.TeamSettings.ExperimentalTownSquareIsReadOnly = disableTownSquareReadOnly }) - utils.SetIsLicensed(isLicensed) - utils.SetLicense(license) - }() th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.ExperimentalTownSquareIsReadOnly = true }) - utils.SetIsLicensed(true) - utils.SetLicense(&model.License{Features: &model.Features{}}) - utils.License().Features.SetDefaults() + th.App.SetLicense(model.NewTestLicense()) if _, err := th.BasicClient.DoPost(url, fmt.Sprintf("{\"text\":\"this is a test\", \"channel\":\"%s\"}", model.DEFAULT_CHANNEL), "application/json"); err == nil { t.Fatal("should have failed -- ExperimentalTownSquareIsReadOnly is true and it's a read only channel") |