mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Merge branch 'release-4.3'
This commit is contained in:
@@ -61,6 +61,11 @@ func TestCreatePost(t *testing.T) {
|
||||
t.Fatal("Newly craeted post shouldn't have EditAt set")
|
||||
}
|
||||
|
||||
_, err = Client.CreatePost(&model.Post{ChannelId: channel1.Id, Message: "#hashtag a" + model.NewId() + "a", Type: model.POST_SYSTEM_GENERIC})
|
||||
if err == nil {
|
||||
t.Fatal("should have failed - bad post type")
|
||||
}
|
||||
|
||||
post2 := &model.Post{ChannelId: channel1.Id, Message: "zz" + model.NewId() + "a", RootId: rpost1.Data.(*model.Post).Id}
|
||||
rpost2, err := Client.CreatePost(post2)
|
||||
if err != nil {
|
||||
@@ -454,13 +459,12 @@ func TestUpdatePost(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
post3 := &model.Post{ChannelId: channel1.Id, Message: "zz" + model.NewId() + "a", Type: model.POST_JOIN_LEAVE}
|
||||
rpost3, err := Client.CreatePost(post3)
|
||||
rpost3, err := th.App.CreatePost(&model.Post{ChannelId: channel1.Id, Message: "zz" + model.NewId() + "a", Type: model.POST_JOIN_LEAVE, UserId: th.BasicUser.Id}, channel1, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
up3 := &model.Post{Id: rpost3.Data.(*model.Post).Id, ChannelId: channel1.Id, Message: "zz" + model.NewId() + " update post 3"}
|
||||
up3 := &model.Post{Id: rpost3.Id, ChannelId: channel1.Id, Message: "zz" + model.NewId() + " update post 3"}
|
||||
if _, err := Client.UpdatePost(up3); err == nil {
|
||||
t.Fatal("shouldn't have been able to update system message")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user