summaryrefslogtreecommitdiffstats
path: root/model/client4_test.go
diff options
context:
space:
mode:
authorJonathan Fritz <jonathan.fritz@mattermost.com>2018-02-13 08:39:56 -0500
committerJonathan Fritz <jonathan.fritz@mattermost.com>2018-02-13 08:39:56 -0500
commit18fa32567b56584c6e24da2ae68814d5bf8ece6f (patch)
tree311ab6a3918ba64ac665286f15950b32dc1b1dba /model/client4_test.go
parent7b2861de3a09cf00d00b0872cc537d54302c4bfa (diff)
parent8b79f5d49cb8d4877e136a76e515edef41ef6f28 (diff)
downloadchat-18fa32567b56584c6e24da2ae68814d5bf8ece6f.tar.gz
chat-18fa32567b56584c6e24da2ae68814d5bf8ece6f.tar.bz2
chat-18fa32567b56584c6e24da2ae68814d5bf8ece6f.zip
Merge branch 'release-4.7' into XYZ-110
Diffstat (limited to 'model/client4_test.go')
-rw-r--r--model/client4_test.go58
1 files changed, 0 insertions, 58 deletions
diff --git a/model/client4_test.go b/model/client4_test.go
deleted file mode 100644
index f7923fa8f..000000000
--- a/model/client4_test.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-package model
-
-import (
- "net/http"
- "net/http/httptest"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-// https://github.com/mattermost/mattermost-server/issues/8205
-func TestClient4CreatePost(t *testing.T) {
- post := &Post{
- Props: map[string]interface{}{
- "attachments": []*SlackAttachment{
- &SlackAttachment{
- Actions: []*PostAction{
- &PostAction{
- Integration: &PostActionIntegration{
- Context: map[string]interface{}{
- "foo": "bar",
- },
- URL: "http://foo.com",
- },
- Name: "Foo",
- },
- },
- },
- },
- },
- }
-
- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- attachments := PostFromJson(r.Body).Attachments()
- assert.Equal(t, []*SlackAttachment{
- &SlackAttachment{
- Actions: []*PostAction{
- &PostAction{
- Integration: &PostActionIntegration{
- Context: map[string]interface{}{
- "foo": "bar",
- },
- URL: "http://foo.com",
- },
- Name: "Foo",
- },
- },
- },
- }, attachments)
- }))
-
- client := NewAPIv4Client(server.URL)
- _, resp := client.CreatePost(post)
- assert.Equal(t, http.StatusOK, resp.StatusCode)
-}