summaryrefslogtreecommitdiffstats
path: root/model/channel_test.go
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-10-27 11:04:23 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-10-27 12:46:31 -0400
commit61da22ea32a71015191e94665171e9703bd39211 (patch)
tree44c236004bade907e5c437f9911a1a090203bf65 /model/channel_test.go
parent887d205b1fbb3188331a324ba59b7ec187a2d772 (diff)
downloadchat-61da22ea32a71015191e94665171e9703bd39211.tar.gz
chat-61da22ea32a71015191e94665171e9703bd39211.tar.bz2
chat-61da22ea32a71015191e94665171e9703bd39211.zip
Added Channel.Purpose on the server
Diffstat (limited to 'model/channel_test.go')
-rw-r--r--model/channel_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/model/channel_test.go b/model/channel_test.go
index e5dfa3734..590417cfe 100644
--- a/model/channel_test.go
+++ b/model/channel_test.go
@@ -67,6 +67,26 @@ func TestChannelIsValid(t *testing.T) {
if err := o.IsValid(); err != nil {
t.Fatal(err)
}
+
+ o.Header = strings.Repeat("01234567890", 100)
+ if err := o.IsValid(); err == nil {
+ t.Fatal("should be invalid")
+ }
+
+ o.Header = "1234"
+ if err := o.IsValid(); err != nil {
+ t.Fatal(err)
+ }
+
+ o.Purpose = strings.Repeat("01234567890", 20)
+ if err := o.IsValid(); err == nil {
+ t.Fatal("should be invalid")
+ }
+
+ o.Purpose = "1234"
+ if err := o.IsValid(); err != nil {
+ t.Fatal(err)
+ }
}
func TestChannelPreSave(t *testing.T) {