mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user