diff options
author | Chris <ccbrown112@gmail.com> | 2017-09-12 09:19:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-12 09:19:52 -0500 |
commit | b066b6df138e88e75cb40f1ec3e58fbd13e61909 (patch) | |
tree | 7ee0e8c935cd3bbafd15d0d07d8900af8b82a4e0 /app/webhook_test.go | |
parent | 674a606bd00b276d0a05b3b29a3d5f5e5e7f8206 (diff) | |
download | chat-b066b6df138e88e75cb40f1ec3e58fbd13e61909.tar.gz chat-b066b6df138e88e75cb40f1ec3e58fbd13e61909.tar.bz2 chat-b066b6df138e88e75cb40f1ec3e58fbd13e61909.zip |
Remove global app references (#7433)
* remove global app references
* test fix
* fix api4 test compilation
Diffstat (limited to 'app/webhook_test.go')
-rw-r--r-- | app/webhook_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/webhook_test.go b/app/webhook_test.go index fe1b34841..0a6bd0fb5 100644 --- a/app/webhook_test.go +++ b/app/webhook_test.go @@ -11,9 +11,8 @@ import ( ) func TestCreateWebhookPost(t *testing.T) { - a := Global() - th := a.Setup().InitBasic() - defer a.TearDown() + th := Setup().InitBasic() + defer th.App.TearDown() enableIncomingHooks := utils.Cfg.ServiceSettings.EnableIncomingWebhooks defer func() { @@ -23,13 +22,13 @@ func TestCreateWebhookPost(t *testing.T) { utils.Cfg.ServiceSettings.EnableIncomingWebhooks = true utils.SetDefaultRolesBasedOnConfig() - hook, err := a.CreateIncomingWebhookForChannel(th.BasicUser.Id, th.BasicChannel, &model.IncomingWebhook{ChannelId: th.BasicChannel.Id}) + hook, err := th.App.CreateIncomingWebhookForChannel(th.BasicUser.Id, th.BasicChannel, &model.IncomingWebhook{ChannelId: th.BasicChannel.Id}) if err != nil { t.Fatal(err.Error()) } - defer a.DeleteIncomingWebhook(hook.Id) + defer th.App.DeleteIncomingWebhook(hook.Id) - post, err := a.CreateWebhookPost(hook.UserId, th.BasicChannel, "foo", "user", "http://iconurl", model.StringInterface{ + post, err := th.App.CreateWebhookPost(hook.UserId, th.BasicChannel, "foo", "user", "http://iconurl", model.StringInterface{ "attachments": []*model.SlackAttachment{ &model.SlackAttachment{ Text: "text", |