diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-12-05 09:14:03 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-05 09:14:03 -0500 |
commit | 7a1f81cd52c4b58a058ae11e361a80ee3b24d141 (patch) | |
tree | 8845eba3280d1ac17a0f0014979e4a995a55e023 /plugin/rpcplugin/api_test.go | |
parent | 46f51197fb8197fe8a5468c86aad64eeab815bad (diff) | |
download | chat-7a1f81cd52c4b58a058ae11e361a80ee3b24d141.tar.gz chat-7a1f81cd52c4b58a058ae11e361a80ee3b24d141.tar.bz2 chat-7a1f81cd52c4b58a058ae11e361a80ee3b24d141.zip |
Add GetChannelMember method to plugin API (#7930)
Diffstat (limited to 'plugin/rpcplugin/api_test.go')
-rw-r--r-- | plugin/rpcplugin/api_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugin/rpcplugin/api_test.go b/plugin/rpcplugin/api_test.go index 0c7321162..8a36ef4f6 100644 --- a/plugin/rpcplugin/api_test.go +++ b/plugin/rpcplugin/api_test.go @@ -54,6 +54,11 @@ func TestAPI(t *testing.T) { Id: "thechannelid", } + testChannelMember := &model.ChannelMember{ + ChannelId: "thechannelid", + UserId: "theuserid", + } + testTeam := &model.Team{ Id: "theteamid", } @@ -111,6 +116,11 @@ func TestAPI(t *testing.T) { assert.Equal(t, testChannel, channel) assert.Nil(t, err) + api.On("GetChannelMember", "thechannelid", "theuserid").Return(testChannelMember, nil).Once() + member, err := remote.GetChannelMember("thechannelid", "theuserid") + assert.Equal(t, testChannelMember, member) + assert.Nil(t, err) + api.On("CreateUser", mock.AnythingOfType("*model.User")).Return(func(u *model.User) (*model.User, *model.AppError) { u.Id = "theuserid" return u, nil |