Change quote so it doesn't display as weird chars in webhooks (#2861)

This commit is contained in:
Tomas Touceda
2021-11-09 18:58:22 -03:00
committed by GitHub
parent 01959434cb
commit 058ee84419
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ func TriggerHostStatusWebhook(
message := fmt.Sprintf(
"More than %.2f%% of your hosts have not checked into Fleet for more than %d days. "+
"Youve been sent this message because the Host status webhook is enabled in your Fleet instance.",
"You've been sent this message because the Host status webhook is enabled in your Fleet instance.",
percentUnseen, appConfig.WebhookSettings.HostStatusWebhook.DaysCount,
)
payload := map[string]interface{}{
+1 -1
View File
@@ -45,7 +45,7 @@ func TestTriggerHostStatusWebhook(t *testing.T) {
require.NoError(t, TriggerHostStatusWebhook(context.Background(), ds, kitlog.NewNopLogger(), ac))
assert.Equal(
t,
`{"data":{"days_unseen":2,"total_hosts":10,"unseen_hosts":6},"text":"More than 60.00% of your hosts have not checked into Fleet for more than 2 days. Youve been sent this message because the Host status webhook is enabled in your Fleet instance."}`,
`{"data":{"days_unseen":2,"total_hosts":10,"unseen_hosts":6},"text":"More than 60.00% of your hosts have not checked into Fleet for more than 2 days. You've been sent this message because the Host status webhook is enabled in your Fleet instance."}`,
requestBody,
)
requestBody = ""