added the custom icon and username for the outgoing webhook and its response (#9141)

* 8272 added the username and icon as part of the model and persisted the same

* 8272 added the custome icon and name when set to the web hook response

* 8272 changed the infinte loop to timeout after 5 seconds

* 8272  fixed review comments
Этот коммит содержится в:
Pradeep Murugesan
2018-07-25 14:31:41 +02:00
коммит произвёл Jesse Hallam
родитель b89ccca929
Коммит b3c2ecd9b9
9 изменённых файлов: 236 добавлений и 2 удалений

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

@@ -239,6 +239,8 @@ func testWebhookStoreSaveOutgoing(t *testing.T, ss store.Store) {
o1.CreatorId = model.NewId()
o1.TeamId = model.NewId()
o1.CallbackURLs = []string{"http://nowhere.com/"}
o1.Username = "test-user-name"
o1.IconURL = "http://nowhere.com/icon"
if err := (<-ss.Webhook().SaveOutgoing(&o1)).Err; err != nil {
t.Fatal("couldn't save item", err)
@@ -255,6 +257,8 @@ func testWebhookStoreGetOutgoing(t *testing.T, ss store.Store) {
o1.CreatorId = model.NewId()
o1.TeamId = model.NewId()
o1.CallbackURLs = []string{"http://nowhere.com/"}
o1.Username = "test-user-name"
o1.IconURL = "http://nowhere.com/icon"
o1 = (<-ss.Webhook().SaveOutgoing(o1)).Data.(*model.OutgoingWebhook)
@@ -461,10 +465,13 @@ func testWebhookStoreUpdateOutgoing(t *testing.T, ss store.Store) {
o1.CreatorId = model.NewId()
o1.TeamId = model.NewId()
o1.CallbackURLs = []string{"http://nowhere.com/"}
o1.Username = "test-user-name"
o1.IconURL = "http://nowhere.com/icon"
o1 = (<-ss.Webhook().SaveOutgoing(o1)).Data.(*model.OutgoingWebhook)
o1.Token = model.NewId()
o1.Username = "another-test-user-name"
if r2 := <-ss.Webhook().UpdateOutgoing(o1); r2.Err != nil {
t.Fatal(r2.Err)