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 --- app/command_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'app/command_test.go') diff --git a/app/command_test.go b/app/command_test.go index b37e78ea9..de4822436 100644 --- a/app/command_test.go +++ b/app/command_test.go @@ -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") + } +} -- cgit v1.2.3-1-g7c22