summaryrefslogtreecommitdiffstats
path: root/model/outgoing_webhook_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/outgoing_webhook_test.go')
-rw-r--r--model/outgoing_webhook_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/model/outgoing_webhook_test.go b/model/outgoing_webhook_test.go
index 49441cfea..3241e649f 100644
--- a/model/outgoing_webhook_test.go
+++ b/model/outgoing_webhook_test.go
@@ -121,6 +121,26 @@ func TestOutgoingWebhookIsValid(t *testing.T) {
if err := o.IsValid(); err != nil {
t.Fatal(err)
}
+
+ o.Username = strings.Repeat("1", 65)
+ if err := o.IsValid(); err == nil {
+ t.Fatal("should be invalid")
+ }
+
+ o.Username = strings.Repeat("1", 64)
+ if err := o.IsValid(); err != nil {
+ t.Fatal("should be invalid")
+ }
+
+ o.IconURL = strings.Repeat("1", 1025)
+ if err := o.IsValid(); err == nil {
+ t.Fatal(err)
+ }
+
+ o.IconURL = strings.Repeat("1", 1024)
+ if err := o.IsValid(); err != nil {
+ t.Fatal(err)
+ }
}
func TestOutgoingWebhookPayloadToFormValues(t *testing.T) {