diff options
author | Druhin Bala <theblueskies@users.noreply.github.com> | 2018-07-18 05:49:48 -0500 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2018-07-18 11:49:48 +0100 |
commit | 301e7eb1c424be9c3fb00401fdc2ea387bddee05 (patch) | |
tree | 7add86db67f23fc1749709af770d97b00afe2c5e /cmd/mattermost/commands/channel_test.go | |
parent | b367b1ff4064557deacae0f7ecf77fae4624b8c6 (diff) | |
download | chat-301e7eb1c424be9c3fb00401fdc2ea387bddee05.tar.gz chat-301e7eb1c424be9c3fb00401fdc2ea387bddee05.tar.bz2 chat-301e7eb1c424be9c3fb00401fdc2ea387bddee05.zip |
MM-10699 Add channel renaming to CLI (#9094)
Diffstat (limited to 'cmd/mattermost/commands/channel_test.go')
-rw-r--r-- | cmd/mattermost/commands/channel_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/mattermost/commands/channel_test.go b/cmd/mattermost/commands/channel_test.go index 8fec971ca..9632ee432 100644 --- a/cmd/mattermost/commands/channel_test.go +++ b/cmd/mattermost/commands/channel_test.go @@ -9,6 +9,7 @@ import ( "github.com/mattermost/mattermost-server/api4" "github.com/mattermost/mattermost-server/model" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -113,3 +114,16 @@ func TestCreateChannel(t *testing.T) { name = name + "-private" CheckCommand(t, "channel", "create", "--display_name", name, "--team", th.BasicTeam.Name, "--private", "--name", name) } + +func TestRenameChannel(t *testing.T) { + th := api4.Setup().InitBasic() + defer th.TearDown() + + channel := th.CreatePublicChannel() + CheckCommand(t, "channel", "rename", th.BasicTeam.Name+":"+channel.Name, "newchannelname10", "--display_name", "New Display Name") + + // Get the channel from the DB + updatedChannel, _ := th.App.GetChannel(channel.Id) + assert.Equal(t, "newchannelname10", updatedChannel.Name) + assert.Equal(t, "New Display Name", updatedChannel.DisplayName) +} |