From 9adaf53e110e0e806b21903111aacb93129668cb Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 9 Oct 2017 13:30:48 -0400 Subject: PLT-7818 Updates to post type (#7579) * Updates to post type * Update tests --- api4/post_test.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'api4') 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) -- cgit v1.2.3-1-g7c22