From 9d405381068874b90b2ffe0327b8eb5689c60d95 Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 15 Sep 2016 12:33:16 -0300 Subject: PLT-4157 CLI to make a user active or inactive (#4025) --- api/cli_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'api') diff --git a/api/cli_test.go b/api/cli_test.go index c25394c17..de2347058 100644 --- a/api/cli_test.go +++ b/api/cli_test.go @@ -417,3 +417,27 @@ func TestCliCreateChannel(t *testing.T) { t.Fatal() } } + +func TestCliMakeUserActiveAndInactive(t *testing.T) { + if disableCliTests { + return + } + + th := Setup().InitBasic() + + // first inactivate the user + cmd := exec.Command("bash", "-c", `go run ../mattermost.go -activate_user -inactive -email="`+th.BasicUser.Email+`"`) + output, err := cmd.CombinedOutput() + if err != nil { + t.Log(string(output)) + t.Fatal() + } + + // activate the inactive user + cmd2 := exec.Command("bash", "-c", `go run ../mattermost.go -activate_user -email="`+th.BasicUser.Email+`"`) + output2, err2 := cmd2.CombinedOutput() + if err2 != nil { + t.Log(string(output2)) + t.Fatal() + } +} -- cgit v1.2.3-1-g7c22