summaryrefslogtreecommitdiffstats
path: root/api4/post_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-10-09 13:30:48 -0400
committerChris <ccbrown112@gmail.com>2017-10-09 10:30:48 -0700
commit9adaf53e110e0e806b21903111aacb93129668cb (patch)
treeedea5dfe0b71945142898840d0485adb57750b31 /api4/post_test.go
parent0da0cf1a21d7dea61f4459ee71bf01b6ca362aee (diff)
downloadchat-9adaf53e110e0e806b21903111aacb93129668cb.tar.gz
chat-9adaf53e110e0e806b21903111aacb93129668cb.tar.bz2
chat-9adaf53e110e0e806b21903111aacb93129668cb.zip
PLT-7818 Updates to post type (#7579)
* Updates to post type * Update tests
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)