summaryrefslogtreecommitdiffstats
path: root/api/webhook_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-07-05 11:32:28 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-07-05 11:32:28 -0400
commitf9e5a9029c73a0b9499990f0e344a096c9aacf01 (patch)
tree10f05442d740cffb96b2ac529d566fadfe62e53b /api/webhook_test.go
parentc0392a60c8a0b6158255b516f30eb79e43971b6b (diff)
downloadchat-f9e5a9029c73a0b9499990f0e344a096c9aacf01.tar.gz
chat-f9e5a9029c73a0b9499990f0e344a096c9aacf01.tar.bz2
chat-f9e5a9029c73a0b9499990f0e344a096c9aacf01.zip
Fixed error when adding incoming webhook to public channel not currently in (#3483)
Diffstat (limited to 'api/webhook_test.go')
-rw-r--r--api/webhook_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/api/webhook_test.go b/api/webhook_test.go
index 80ee8ad7d..95e4d92be 100644
--- a/api/webhook_test.go
+++ b/api/webhook_test.go
@@ -18,6 +18,7 @@ func TestCreateIncomingHook(t *testing.T) {
team := th.SystemAdminTeam
channel1 := th.CreateChannel(Client, team)
channel2 := th.CreatePrivateChannel(Client, team)
+ channel3 := th.CreateChannel(Client, team)
user2 := th.CreateUser(Client)
LinkUserToTeam(user2, team)
@@ -68,6 +69,13 @@ func TestCreateIncomingHook(t *testing.T) {
}
}
+ Client.Must(Client.LeaveChannel(channel3.Id))
+
+ hook = &model.IncomingWebhook{ChannelId: channel3.Id, UserId: user.Id, TeamId: team.Id}
+ if _, err := Client.CreateIncomingWebhook(hook); err != nil {
+ t.Fatal(err)
+ }
+
Client.Logout()
Client.Must(Client.LoginById(user2.Id, user2.Password))
Client.SetTeamId(team.Id)