summaryrefslogtreecommitdiffstats
path: root/api/post_test.go
diff options
context:
space:
mode:
authorChristopher Brown <ccbrown112@gmail.com>2017-10-16 23:10:45 -0500
committerChristopher Brown <ccbrown112@gmail.com>2017-10-16 23:10:45 -0500
commit39cc2372695836fdc96059d8b94992b1416f98e1 (patch)
tree56d2beb5420cd0054194f71e53c6a95578beff9a /api/post_test.go
parent89dc3cb126ba46b486997c433adfdf34982fcc81 (diff)
parent8bf47c1211d09079fd9407555026b7b29383ac37 (diff)
downloadchat-39cc2372695836fdc96059d8b94992b1416f98e1.tar.gz
chat-39cc2372695836fdc96059d8b94992b1416f98e1.tar.bz2
chat-39cc2372695836fdc96059d8b94992b1416f98e1.zip
Merge branch 'release-4.3'
Diffstat (limited to 'api/post_test.go')
-rw-r--r--api/post_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/api/post_test.go b/api/post_test.go
index e7c230963..58a9fae73 100644
--- a/api/post_test.go
+++ b/api/post_test.go
@@ -61,6 +61,11 @@ func TestCreatePost(t *testing.T) {
t.Fatal("Newly craeted post shouldn't have EditAt set")
}
+ _, err = Client.CreatePost(&model.Post{ChannelId: channel1.Id, Message: "#hashtag a" + model.NewId() + "a", Type: model.POST_SYSTEM_GENERIC})
+ if err == nil {
+ t.Fatal("should have failed - bad post type")
+ }
+
post2 := &model.Post{ChannelId: channel1.Id, Message: "zz" + model.NewId() + "a", RootId: rpost1.Data.(*model.Post).Id}
rpost2, err := Client.CreatePost(post2)
if err != nil {
@@ -454,13 +459,12 @@ func TestUpdatePost(t *testing.T) {
}
}
- post3 := &model.Post{ChannelId: channel1.Id, Message: "zz" + model.NewId() + "a", Type: model.POST_JOIN_LEAVE}
- rpost3, err := Client.CreatePost(post3)
+ rpost3, err := th.App.CreatePost(&model.Post{ChannelId: channel1.Id, Message: "zz" + model.NewId() + "a", Type: model.POST_JOIN_LEAVE, UserId: th.BasicUser.Id}, channel1, false)
if err != nil {
t.Fatal(err)
}
- up3 := &model.Post{Id: rpost3.Data.(*model.Post).Id, ChannelId: channel1.Id, Message: "zz" + model.NewId() + " update post 3"}
+ up3 := &model.Post{Id: rpost3.Id, ChannelId: channel1.Id, Message: "zz" + model.NewId() + " update post 3"}
if _, err := Client.UpdatePost(up3); err == nil {
t.Fatal("shouldn't have been able to update system message")
}