summaryrefslogtreecommitdiffstats
path: root/model/post_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-09-27 11:09:09 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2017-09-27 11:09:09 -0400
commit1bd66589a2adc67df5df9c108a2f2ecc77dfdf44 (patch)
treec01834361dbee38ede126afd0345b9512af885c0 /model/post_test.go
parent62e54a09e642d2af30dc55b66408bb36fae5bda5 (diff)
downloadchat-1bd66589a2adc67df5df9c108a2f2ecc77dfdf44.tar.gz
chat-1bd66589a2adc67df5df9c108a2f2ecc77dfdf44.tar.bz2
chat-1bd66589a2adc67df5df9c108a2f2ecc77dfdf44.zip
Allow custom post types (#7468)
Diffstat (limited to 'model/post_test.go')
-rw-r--r--model/post_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/post_test.go b/model/post_test.go
index 1096ccbd8..ced84f26b 100644
--- a/model/post_test.go
+++ b/model/post_test.go
@@ -78,6 +78,16 @@ func TestPostIsValid(t *testing.T) {
if err := o.IsValid(); err != nil {
t.Fatal(err)
}
+
+ o.Type = "junk"
+ if err := o.IsValid(); err == nil {
+ t.Fatal("should be invalid")
+ }
+
+ o.Type = POST_CUSTOM_TYPE_PREFIX + "type"
+ if err := o.IsValid(); err != nil {
+ t.Fatal(err)
+ }
}
func TestPostPreSave(t *testing.T) {