EE: PLT-3747 Add create_channel to command line (#3760)

* PLT-3747 Add create_channel command line

* Added tests

* Set as EE feature
This commit is contained in:
enahum
2016-08-12 06:50:11 -05:00
committed by Joram Wilander
parent c0a905c037
commit 53c068952c
2 changed files with 131 additions and 6 deletions

View File

@@ -389,3 +389,31 @@ func TestCliResetPassword(t *testing.T) {
th.BasicUser.Password = "password2"
th.LoginBasic()
}
func TestCliCreateChannel(t *testing.T) {
if disableCliTests {
return
}
th := Setup().InitBasic()
id := model.NewId()
name := "name" + id
// should fail because channel does not have license
cmd := exec.Command("bash", "-c", `go run ../mattermost.go -create_channel -email="`+th.BasicUser.Email+`" -team_name="`+th.BasicTeam.Name+`" -channel_type="O" -channel_name="`+name+`"`)
output, err := cmd.CombinedOutput()
if err == nil {
t.Log(string(output))
t.Fatal()
}
// should fail because channel does not have license
name = name + "-private"
cmd2 := exec.Command("bash", "-c", `go run ../mattermost.go -create_channel -email="`+th.BasicUser.Email+`" -team_name="`+th.BasicTeam.Name+`" -channel_type="P" -channel_name="`+name+`"`)
output2, err2 := cmd2.CombinedOutput()
if err2 == nil {
t.Log(string(output2))
t.Fatal()
}
}