summaryrefslogtreecommitdiffstats
path: root/app/command_remove_test.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-10-01 13:51:12 +0100
committerGitHub <noreply@github.com>2018-10-01 13:51:12 +0100
commita0f75cadb2b0fa91f6e321b1b8b859519b2ec865 (patch)
tree49d6333eba0aa4cc02355a740c757500e9ee4798 /app/command_remove_test.go
parent71e3afaf63631583202f824424ced2e3aa02d140 (diff)
downloadchat-a0f75cadb2b0fa91f6e321b1b8b859519b2ec865.tar.gz
chat-a0f75cadb2b0fa91f6e321b1b8b859519b2ec865.tar.bz2
chat-a0f75cadb2b0fa91f6e321b1b8b859519b2ec865.zip
MM-12110: Don't /invite or /kick deactivated users. (#9494)
Diffstat (limited to 'app/command_remove_test.go')
-rw-r--r--app/command_remove_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/command_remove_test.go b/app/command_remove_test.go
index f17a70bad..66257f563 100644
--- a/app/command_remove_test.go
+++ b/app/command_remove_test.go
@@ -106,4 +106,19 @@ func TestRemoveProviderDoCommand(t *testing.T) {
actual = rp.DoCommand(th.App, args, user1.Username).Text
assert.Equal(t, "api.command_remove.direct_group.app_error", actual)
+
+ // Try a public channel with a deactivated user.
+ deactivatedUser := th.CreateUser()
+ th.App.AddUserToTeam(th.BasicTeam.Id, deactivatedUser.Id, deactivatedUser.Id)
+ th.App.AddUserToChannel(deactivatedUser, publicChannel)
+ th.App.UpdateActive(deactivatedUser, false)
+
+ args = &model.CommandArgs{
+ T: func(s string, args ...interface{}) string { return s },
+ ChannelId: publicChannel.Id,
+ Session: model.Session{UserId: th.BasicUser.Id, TeamMembers: []*model.TeamMember{{TeamId: th.BasicTeam.Id, Roles: ""}}},
+ }
+
+ actual = rp.DoCommand(th.App, args, deactivatedUser.Username).Text
+ assert.Equal(t, "api.command_remove.missing.app_error", actual)
}