From f263d2b9510fb557fe075dee5097cb32e2b1e5e2 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 28 Sep 2017 12:08:16 -0400 Subject: PLT-7684 Add support to outgoing webhooks and slash commands to set post type and props (#7531) * Add support to outgoing webhooks and slash commands to set post type and props * Fix nil access --- model/outgoing_webhook_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'model/outgoing_webhook_test.go') diff --git a/model/outgoing_webhook_test.go b/model/outgoing_webhook_test.go index 431b1f6c1..2412271b5 100644 --- a/model/outgoing_webhook_test.go +++ b/model/outgoing_webhook_test.go @@ -176,3 +176,16 @@ func TestOutgoingWebhookTriggerWordStartsWith(t *testing.T) { t.Fatal("Should return false") } } + +func TestOutgoingWebhookResponseJson(t *testing.T) { + o := OutgoingWebhookResponse{} + o.Text = new(string) + *o.Text = "some text" + + json := o.ToJson() + ro := OutgoingWebhookResponseFromJson(strings.NewReader(json)) + + if *o.Text != *ro.Text { + t.Fatal("Text does not match") + } +} -- cgit v1.2.3-1-g7c22