From 441156b91e9f9bac6b5592616551e2920c4cb33b Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Wed, 30 Mar 2016 10:56:20 -0400 Subject: Added DisplayName and Description fields to both types of webhooks and slash commands --- model/incoming_webhook_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'model/incoming_webhook_test.go') diff --git a/model/incoming_webhook_test.go b/model/incoming_webhook_test.go index 5297d7d90..3f1754244 100644 --- a/model/incoming_webhook_test.go +++ b/model/incoming_webhook_test.go @@ -69,6 +69,26 @@ func TestIncomingWebhookIsValid(t *testing.T) { if err := o.IsValid(); err != nil { t.Fatal(err) } + + o.DisplayName = strings.Repeat("1", 65) + if err := o.IsValid(); err == nil { + t.Fatal("should be invalid") + } + + o.DisplayName = strings.Repeat("1", 64) + if err := o.IsValid(); err != nil { + t.Fatal(err) + } + + o.Description = strings.Repeat("1", 129) + if err := o.IsValid(); err == nil { + t.Fatal("should be invalid") + } + + o.Description = strings.Repeat("1", 128) + if err := o.IsValid(); err != nil { + t.Fatal(err) + } } func TestIncomingWebhookPreSave(t *testing.T) { -- cgit v1.2.3-1-g7c22