[PLT-8173] Strip the post_ prefix on incoming webhook overrides. (#8019)

This commit is contained in:
Jesse Hallam
2018-01-03 10:35:36 -05:00
committed by Joram Wilander
parent 15cc449758
commit e5dad3cf68
7 changed files with 86 additions and 82 deletions
+8 -8
View File
@@ -425,8 +425,8 @@ func TestUpdateIncomingHook(t *testing.T) {
createdHook.DisplayName = "hook2"
createdHook.Description = "description"
createdHook.ChannelId = th.BasicChannel2.Id
createdHook.PostUsername = "username"
createdHook.PostIconURL = "icon"
createdHook.Username = "username"
createdHook.IconURL = "icon"
updatedHook, resp := th.SystemAdminClient.UpdateIncomingWebhook(createdHook)
CheckNoError(t, resp)
@@ -443,11 +443,11 @@ func TestUpdateIncomingHook(t *testing.T) {
t.Fatal("Hook channel is not updated")
}
if updatedHook.PostUsername != "" {
if updatedHook.Username != "" {
t.Fatal("Hook username was incorrectly updated")
}
if updatedHook.PostIconURL != "" {
if updatedHook.IconURL != "" {
t.Fatal("Hook icon was incorrectly updated")
}
} else {
@@ -465,8 +465,8 @@ func TestUpdateIncomingHook(t *testing.T) {
createdHook.DisplayName = "hook2"
createdHook.Description = "description"
createdHook.ChannelId = th.BasicChannel2.Id
createdHook.PostUsername = "username"
createdHook.PostIconURL = "icon"
createdHook.Username = "username"
createdHook.IconURL = "icon"
updatedHook, resp := th.SystemAdminClient.UpdateIncomingWebhook(createdHook)
CheckNoError(t, resp)
@@ -483,11 +483,11 @@ func TestUpdateIncomingHook(t *testing.T) {
t.Fatal("Hook channel is not updated")
}
if updatedHook.PostUsername != "username" {
if updatedHook.Username != "username" {
t.Fatal("Hook username is not updated")
}
if updatedHook.PostIconURL != "icon" {
if updatedHook.IconURL != "icon" {
t.Fatal("Hook icon is not updated")
}
} else {