summaryrefslogtreecommitdiffstats
path: root/api/cli_test.go
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-09-15 12:33:16 -0300
committerHarrison Healey <harrisonmhealey@gmail.com>2016-09-15 11:33:16 -0400
commit9d405381068874b90b2ffe0327b8eb5689c60d95 (patch)
treecb3dc436735806e553d7e3c1a4eba6222fda3d9f /api/cli_test.go
parent2659d19d05c033d84a22d916e2b8eb709dcf23dc (diff)
downloadchat-9d405381068874b90b2ffe0327b8eb5689c60d95.tar.gz
chat-9d405381068874b90b2ffe0327b8eb5689c60d95.tar.bz2
chat-9d405381068874b90b2ffe0327b8eb5689c60d95.zip
PLT-4157 CLI to make a user active or inactive (#4025)
Diffstat (limited to 'api/cli_test.go')
-rw-r--r--api/cli_test.go24
1 files changed, 24 insertions, 0 deletions
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()
+ }
+}