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

* PLT-3747 Add create_channel command line

* Added tests

* Set as EE feature
Этот коммит содержится в:
enahum
2016-08-12 06:50:11 -05:00
коммит произвёл Joram Wilander
родитель c0a905c037
Коммит 53c068952c
2 изменённых файлов: 131 добавлений и 6 удалений

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

@@ -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()
}
}