diff options
author | Chris <ccbrown112@gmail.com> | 2017-10-23 02:39:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 02:39:51 -0700 |
commit | 08b7b1c4144f18a9dbf52bfe0eb9182f2b4eba4a (patch) | |
tree | 6f2613d6032cfb6d357925c0f64cc02920694549 /app/channel_test.go | |
parent | fd6192473b3c2a91d1520e366d931063e359a67d (diff) | |
download | chat-08b7b1c4144f18a9dbf52bfe0eb9182f2b4eba4a.tar.gz chat-08b7b1c4144f18a9dbf52bfe0eb9182f2b4eba4a.tar.bz2 chat-08b7b1c4144f18a9dbf52bfe0eb9182f2b4eba4a.zip |
Reduce cfg boilerplate (#7689)
* reduce cfg boilerplate
* fix compile error
* user test fix
* another test fix
* simplify diagnostics / testing
Diffstat (limited to 'app/channel_test.go')
-rw-r--r-- | app/channel_test.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/app/channel_test.go b/app/channel_test.go index b1d403896..374b20657 100644 --- a/app/channel_test.go +++ b/app/channel_test.go @@ -4,21 +4,16 @@ import ( "testing" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func TestPermanentDeleteChannel(t *testing.T) { th := Setup().InitBasic() defer th.TearDown() - incomingWasEnabled := utils.Cfg.ServiceSettings.EnableIncomingWebhooks - outgoingWasEnabled := utils.Cfg.ServiceSettings.EnableOutgoingWebhooks - utils.Cfg.ServiceSettings.EnableIncomingWebhooks = true - utils.Cfg.ServiceSettings.EnableOutgoingWebhooks = true - defer func() { - utils.Cfg.ServiceSettings.EnableIncomingWebhooks = incomingWasEnabled - utils.Cfg.ServiceSettings.EnableOutgoingWebhooks = outgoingWasEnabled - }() + th.App.UpdateConfig(func(cfg *model.Config) { + cfg.ServiceSettings.EnableIncomingWebhooks = true + cfg.ServiceSettings.EnableOutgoingWebhooks = true + }) channel, err := th.App.CreateChannel(&model.Channel{DisplayName: "deletion-test", Name: "deletion-test", Type: model.CHANNEL_OPEN, TeamId: th.BasicTeam.Id}, false) if err != nil { |