* Updates to post type

* Update tests
Этот коммит содержится в:
Joram Wilander
2017-10-09 13:30:48 -04:00
коммит произвёл Chris
родитель 0da0cf1a21
Коммит 9adaf53e11
7 изменённых файлов: 58 добавлений и 6 удалений

Просмотреть файл

@@ -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)