Add GetChannelMember method to plugin API (#7930)

Этот коммит содержится в:
Joram Wilander
2017-12-05 09:14:03 -05:00
коммит произвёл GitHub
родитель 46f51197fb
Коммит 7a1f81cd52
5 изменённых файлов: 57 добавлений и 0 удалений

Просмотреть файл

@@ -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