summaryrefslogtreecommitdiffstats
path: root/app/webhook_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/webhook_test.go')
-rw-r--r--app/webhook_test.go11
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",