diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-06-25 12:33:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 12:33:13 -0700 |
commit | 1e5c432e1029601a664454388ae366ef69618d62 (patch) | |
tree | cb9e8bfb66640ac3b29c934bb2c3202d25aeb368 /plugin/example_test.go | |
parent | ecefa6cdd1e7376046bbec82c1b47f7756fea646 (diff) | |
download | chat-1e5c432e1029601a664454388ae366ef69618d62.tar.gz chat-1e5c432e1029601a664454388ae366ef69618d62.tar.bz2 chat-1e5c432e1029601a664454388ae366ef69618d62.zip |
MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.
* Tweaks from feedback.
Diffstat (limited to 'plugin/example_test.go')
-rw-r--r-- | plugin/example_test.go | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/plugin/example_test.go b/plugin/example_test.go deleted file mode 100644 index e6ae3c2ea..000000000 --- a/plugin/example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package plugin_test - -import ( - "io/ioutil" - "net/http/httptest" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/plugin/plugintest" -) - -func TestHelloUserPlugin(t *testing.T) { - user := &model.User{ - Id: model.NewId(), - Username: "billybob", - } - - api := &plugintest.API{} - api.On("GetUser", user.Id).Return(user, nil) - defer api.AssertExpectations(t) - - p := &HelloUserPlugin{} - p.OnActivate(api) - - w := httptest.NewRecorder() - r := httptest.NewRequest("GET", "/", nil) - r.Header.Add("Mattermost-User-Id", user.Id) - p.ServeHTTP(w, r) - body, err := ioutil.ReadAll(w.Result().Body) - require.NoError(t, err) - assert.Equal(t, "Welcome back, billybob!", string(body)) -} |