diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-03-30 00:09:05 +0900 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-03-29 08:09:05 -0700 |
commit | 8a31718db11c803fa3b14f85c760ca9db6083670 (patch) | |
tree | 80a006c8994ef57ccd6d09fc7b0d00ebe6969f39 /api4/apitestlib.go | |
parent | 64f80decaf4c20c643e43426e3c4285b2d501a90 (diff) | |
download | chat-8a31718db11c803fa3b14f85c760ca9db6083670.tar.gz chat-8a31718db11c803fa3b14f85c760ca9db6083670.tar.bz2 chat-8a31718db11c803fa3b14f85c760ca9db6083670.zip |
APIv4 get /channels/{channel_id}/pinned (#5893)
Diffstat (limited to 'api4/apitestlib.go')
-rw-r--r-- | api4/apitestlib.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/api4/apitestlib.go b/api4/apitestlib.go index 87a3976f5..749053271 100644 --- a/api4/apitestlib.go +++ b/api4/apitestlib.go @@ -247,6 +247,10 @@ func (me *TestHelper) CreatePost() *model.Post { return me.CreatePostWithClient(me.Client, me.BasicChannel) } +func (me *TestHelper) CreatePinnedPost() *model.Post { + return me.CreatePinnedPostWithClient(me.Client, me.BasicChannel) +} + func (me *TestHelper) CreateMessagePost(message string) *model.Post { return me.CreateMessagePostWithClient(me.Client, me.BasicChannel, message) } @@ -268,6 +272,24 @@ func (me *TestHelper) CreatePostWithClient(client *model.Client4, channel *model return rpost } +func (me *TestHelper) CreatePinnedPostWithClient(client *model.Client4, channel *model.Channel) *model.Post { + id := model.NewId() + + post := &model.Post{ + ChannelId: channel.Id, + Message: "message_" + id, + IsPinned: true, + } + + utils.DisableDebugLogForTest() + rpost, resp := client.CreatePost(post) + if resp.Error != nil { + panic(resp.Error) + } + utils.EnableDebugLogForTest() + return rpost +} + func (me *TestHelper) CreateMessagePostWithClient(client *model.Client4, channel *model.Channel, message string) *model.Post { post := &model.Post{ ChannelId: channel.Id, |