From c209e4457457edc042f063390c9a222a694f3a6d Mon Sep 17 00:00:00 2001 From: Derrick Anderson Date: Mon, 12 Feb 2018 16:01:02 -0500 Subject: revert master changes --- model/client4_test.go | 58 --------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 model/client4_test.go (limited to 'model/client4_test.go') 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) -} -- cgit v1.2.3-1-g7c22