diff options
Diffstat (limited to 'model/outgoing_webhook_test.go')
-rw-r--r-- | model/outgoing_webhook_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/model/outgoing_webhook_test.go b/model/outgoing_webhook_test.go index 665b85b6f..72c842e03 100644 --- a/model/outgoing_webhook_test.go +++ b/model/outgoing_webhook_test.go @@ -89,6 +89,26 @@ func TestOutgoingWebhookIsValid(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 TestOutgoingWebhookPreSave(t *testing.T) { |