summaryrefslogtreecommitdiffstats
path: root/app/command_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-10-09 13:30:48 -0400
committerChris <ccbrown112@gmail.com>2017-10-09 10:30:48 -0700
commit9adaf53e110e0e806b21903111aacb93129668cb (patch)
treeedea5dfe0b71945142898840d0485adb57750b31 /app/command_test.go
parent0da0cf1a21d7dea61f4459ee71bf01b6ca362aee (diff)
downloadchat-9adaf53e110e0e806b21903111aacb93129668cb.tar.gz
chat-9adaf53e110e0e806b21903111aacb93129668cb.tar.bz2
chat-9adaf53e110e0e806b21903111aacb93129668cb.zip
PLT-7818 Updates to post type (#7579)
* Updates to post type * Update tests
Diffstat (limited to 'app/command_test.go')
-rw-r--r--app/command_test.go20
1 files changed, 20 insertions, 0 deletions
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")
+ }
+}