* Updates to post type

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

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

@@ -45,3 +45,23 @@ func TestMoveCommand(t *testing.T) {
assert.Nil(t, err)
assert.EqualValues(t, targetTeam.Id, retrievedCommand.TeamId)
}
func TestCreateCommandPost(t *testing.T) {
th := Setup().InitBasic()
defer th.TearDown()
post := &model.Post{
ChannelId: th.BasicChannel.Id,
UserId: th.BasicUser.Id,
Type: model.POST_SYSTEM_GENERIC,
}
resp := &model.CommandResponse{
Text: "some message",
}
_, err := th.App.CreateCommandPost(post, th.BasicTeam.Id, resp)
if err == nil && err.Id != "api.context.invalid_param.app_error" {
t.Fatal("should have failed - bad post type")
}
}