PLT-2863 adding remove user from team (#3429)

* PLT-2863 adding remove user from team

* PLT-2863 adding the client side UI

* Fixing trailing space

* Fixing reported issues

* Adding documentatino

* Switching to final javascript driver
Этот коммит содержится в:
Corey Hulen
2016-07-06 13:40:59 -08:00
коммит произвёл GitHub
родитель 3eee51f74e
Коммит d5f243dad6
24 изменённых файлов: 572 добавлений и 19 удалений

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

@@ -334,6 +334,43 @@ func TestCliJoinTeam(t *testing.T) {
}
}
func TestCliLeaveTeam(t *testing.T) {
if disableCliTests {
return
}
th := Setup().InitBasic()
cmd := exec.Command("bash", "-c", `go run ../mattermost.go -leave_team -team_name="`+th.BasicTeam.Name+`" -email="`+th.BasicUser.Email+`"`)
output, err := cmd.CombinedOutput()
if err != nil {
t.Log(string(output))
t.Fatal(err)
}
profiles := th.BasicClient.Must(th.BasicClient.GetProfiles(th.BasicTeam.Id, "")).Data.(map[string]*model.User)
found := false
for _, user := range profiles {
if user.Email == th.BasicUser.Email {
found = true
}
}
if !found {
t.Fatal("profile still should be in team even if deleted")
}
if result := <-Srv.Store.Team().GetTeamsByUserId(th.BasicUser.Id); result.Err != nil {
teamMembers := result.Data.([]*model.TeamMember)
if len(teamMembers) > 0 {
t.Fatal("Shouldn't be in team")
}
}
}
func TestCliResetPassword(t *testing.T) {
if disableCliTests {
return