summaryrefslogtreecommitdiffstats
path: root/api4/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 /api4/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 'api4/post_test.go')
-rw-r--r--api4/post_test.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/api4/post_test.go b/api4/post_test.go
index fd6f8031d..27e6d6458 100644
--- a/api4/post_test.go
+++ b/api4/post_test.go
@@ -66,6 +66,13 @@ func TestCreatePost(t *testing.T) {
t.Fatal("create at should not match")
}
+ post.RootId = ""
+ post.ParentId = ""
+ post.Type = model.POST_SYSTEM_GENERIC
+ _, resp = Client.CreatePost(post)
+ CheckBadRequestStatus(t, resp)
+
+ post.Type = ""
post.RootId = rpost2.Id
post.ParentId = rpost2.Id
_, resp = Client.CreatePost(post)
@@ -417,9 +424,10 @@ func TestUpdatePost(t *testing.T) {
t.Fatal("failed to updates")
}
- post2 := &model.Post{ChannelId: channel.Id, Message: "zz" + model.NewId() + "a", Type: model.POST_JOIN_LEAVE}
- rpost2, resp := Client.CreatePost(post2)
- CheckNoError(t, resp)
+ rpost2, err := th.App.CreatePost(&model.Post{ChannelId: channel.Id, Message: "zz" + model.NewId() + "a", Type: model.POST_JOIN_LEAVE, UserId: th.BasicUser.Id}, channel, false)
+ if err != nil {
+ t.Fatal(err)
+ }
up2 := &model.Post{Id: rpost2.Id, ChannelId: channel.Id, Message: "zz" + model.NewId() + " update post 2"}
_, resp = Client.UpdatePost(rpost2.Id, up2)