summaryrefslogtreecommitdiffstats
path: root/model/outgoing_webhook_test.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-03-30 10:56:20 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-04-04 09:45:02 -0400
commit441156b91e9f9bac6b5592616551e2920c4cb33b (patch)
tree64e0c2e8a1329a0b761883fd47c3b588d11a69af /model/outgoing_webhook_test.go
parent785553384fe96027b0e9274b6ccc8623092eda70 (diff)
downloadchat-441156b91e9f9bac6b5592616551e2920c4cb33b.tar.gz
chat-441156b91e9f9bac6b5592616551e2920c4cb33b.tar.bz2
chat-441156b91e9f9bac6b5592616551e2920c4cb33b.zip
Added DisplayName and Description fields to both types of webhooks and slash commands
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 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) {