* remove global app references

* test fix

* fix api4 test compilation
Этот коммит содержится в:
Chris
2017-09-12 09:19:52 -05:00
коммит произвёл GitHub
родитель 674a606bd0
Коммит b066b6df13
37 изменённых файлов: 724 добавлений и 1434 удалений

Просмотреть файл

@@ -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",