summaryrefslogtreecommitdiffstats
path: root/app/command_invite_test.go
diff options
context:
space:
mode:
authorDerrick Anderson <derrick@andersonwebstudio.com>2018-05-15 11:54:24 -0400
committerDerrick Anderson <derrick@andersonwebstudio.com>2018-05-15 11:54:24 -0400
commitfbbe1f7cefd52a27fd52893509b5365d275f9bee (patch)
tree5dae4ebc13fca2749b4278bba772ec13c0924e03 /app/command_invite_test.go
parenta1656dffa98fbc8865e476b214e4e0c562547d39 (diff)
parent228bc4bd1dc84bf741978711b680a06dd9d67613 (diff)
downloadchat-fbbe1f7cefd52a27fd52893509b5365d275f9bee.tar.gz
chat-fbbe1f7cefd52a27fd52893509b5365d275f9bee.tar.bz2
chat-fbbe1f7cefd52a27fd52893509b5365d275f9bee.zip
Merge branch 'merge410rc5'
Diffstat (limited to 'app/command_invite_test.go')
-rw-r--r--app/command_invite_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/command_invite_test.go b/app/command_invite_test.go
index c46bc4628..0d1db4a07 100644
--- a/app/command_invite_test.go
+++ b/app/command_invite_test.go
@@ -18,6 +18,7 @@ func TestInviteProvider(t *testing.T) {
channel := th.createChannel(th.BasicTeam, model.CHANNEL_OPEN)
privateChannel := th.createChannel(th.BasicTeam, model.CHANNEL_PRIVATE)
dmChannel := th.CreateDmChannel(th.BasicUser2)
+ privateChannel2 := th.createChannelWithAnotherUser(th.BasicTeam, model.CHANNEL_PRIVATE, th.BasicUser2.Id)
basicUser3 := th.CreateUser()
th.LinkUserToTeam(basicUser3, th.BasicTeam)
@@ -36,6 +37,7 @@ func TestInviteProvider(t *testing.T) {
userAndDisplayChannel := "@" + th.BasicUser2.Username + " ~" + channel.DisplayName + " "
userAndPrivateChannel := "@" + th.BasicUser2.Username + " ~" + privateChannel.Name
userAndDMChannel := "@" + basicUser3.Username + " ~" + dmChannel.Name
+ userAndInvalidPrivate := "@" + basicUser3.Username + " ~" + privateChannel2.Name
tests := []struct {
desc string
@@ -97,6 +99,11 @@ func TestInviteProvider(t *testing.T) {
expected: "api.command_invite.directchannel.app_error",
msg: userAndDMChannel,
},
+ {
+ desc: "try to add a user to a privante channel with no permission",
+ expected: "api.command_invite.private_channel.app_error",
+ msg: userAndInvalidPrivate,
+ },
}
for _, test := range tests {