summaryrefslogtreecommitdiffstats
path: root/model/incoming_webhook_test.go
diff options
context:
space:
mode:
authorJesse Hallam <jesse.hallam@gmail.com>2018-01-02 11:41:23 -0500
committerChristopher Speller <crspeller@gmail.com>2018-01-02 08:41:23 -0800
commite9fe9f50dd5839a7cf0926a2d97e88a19c9b831e (patch)
tree87073ea7310a356b4f2d78a5b5f569730ef89257 /model/incoming_webhook_test.go
parentb902e4eea9732573d3a3dc9f6a62ca7029cac409 (diff)
downloadchat-e9fe9f50dd5839a7cf0926a2d97e88a19c9b831e.tar.gz
chat-e9fe9f50dd5839a7cf0926a2d97e88a19c9b831e.tar.bz2
chat-e9fe9f50dd5839a7cf0926a2d97e88a19c9b831e.zip
[PLT-8173] Add username and profile picture to webhook set up pages (#8002)
Diffstat (limited to 'model/incoming_webhook_test.go')
-rw-r--r--model/incoming_webhook_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/model/incoming_webhook_test.go b/model/incoming_webhook_test.go
index 5b78f877f..13b416eb0 100644
--- a/model/incoming_webhook_test.go
+++ b/model/incoming_webhook_test.go
@@ -89,6 +89,26 @@ func TestIncomingWebhookIsValid(t *testing.T) {
if err := o.IsValid(); err != nil {
t.Fatal(err)
}
+
+ o.PostUsername = strings.Repeat("1", 65)
+ if err := o.IsValid(); err == nil {
+ t.Fatal("should be invalid")
+ }
+
+ o.PostUsername = strings.Repeat("1", 64)
+ if err := o.IsValid(); err != nil {
+ t.Fatal(err)
+ }
+
+ o.PostIconURL = strings.Repeat("1", 1025)
+ if err := o.IsValid(); err == nil {
+ t.Fatal("should be invalid")
+ }
+
+ o.PostIconURL = strings.Repeat("1", 1024)
+ if err := o.IsValid(); err != nil {
+ t.Fatal(err)
+ }
}
func TestIncomingWebhookPreSave(t *testing.T) {