summaryrefslogtreecommitdiffstats
path: root/model/post_test.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-12-04 11:30:50 -0800
committerCorey Hulen <corey@hulen.com>2015-12-04 11:30:50 -0800
commit1bee1e06e4d0110db274c076860fa97f76471ddb (patch)
tree8f971b54319ae90246ad13905851df545bbb7b89 /model/post_test.go
parent1d67f26664f8cf98f52433ef8b081b6fb485eadb (diff)
parent14d1ec5191867174837e15f616ad3fc1dc8e0dae (diff)
downloadchat-1bee1e06e4d0110db274c076860fa97f76471ddb.tar.gz
chat-1bee1e06e4d0110db274c076860fa97f76471ddb.tar.bz2
chat-1bee1e06e4d0110db274c076860fa97f76471ddb.zip
Merge pull request #1613 from florianorben/PLT-1326
PLT-1326: Enable channel posts of type join or leave not trigger unread notifications
Diffstat (limited to 'model/post_test.go')
-rw-r--r--model/post_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/model/post_test.go b/model/post_test.go
index f498c83e6..cbd323fab 100644
--- a/model/post_test.go
+++ b/model/post_test.go
@@ -98,3 +98,18 @@ func TestPostPreSave(t *testing.T) {
o.Etag()
}
+
+func TestPostIsSystemMessage(t *testing.T) {
+ post1 := Post{Message: "test_1"}
+ post1.PreSave()
+
+ if post1.IsSystemMessage() {
+ t.Fatalf("TestPostIsSystemMessage failed, expected post1.IsSystemMessage() to be false")
+ }
+
+ post2 := Post{Message: "test_2", Type: POST_JOIN_LEAVE}
+ post2.PreSave()
+ if !post2.IsSystemMessage() {
+ t.Fatalf("TestPostIsSystemMessage failed, expected post2.IsSystemMessage() to be true")
+ }
+}