summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-01-23 13:43:07 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2017-01-23 13:43:07 -0500
commit58b3c76c94499e77194d814ebd63ad1e6f3a2d9e (patch)
tree0814deb0df8e700a0124dc02a2e1d3263da9b9e7
parentd1f0cacdc95131334fc754b2bf04ada4dc2dadae (diff)
downloadchat-58b3c76c94499e77194d814ebd63ad1e6f3a2d9e.tar.gz
chat-58b3c76c94499e77194d814ebd63ad1e6f3a2d9e.tar.bz2
chat-58b3c76c94499e77194d814ebd63ad1e6f3a2d9e.zip
Fix adding user to team and add test check (#5172)
-rw-r--r--api/team.go2
-rw-r--r--api/team_test.go4
2 files changed, 5 insertions, 1 deletions
diff --git a/api/team.go b/api/team.go
index 2c5a25a3f..92f9ebaa4 100644
--- a/api/team.go
+++ b/api/team.go
@@ -153,7 +153,7 @@ func addUserToTeam(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if _, err := app.AddUserToTeam(c.TeamId, c.Session.UserId); err != nil {
+ if _, err := app.AddUserToTeam(c.TeamId, userId); err != nil {
c.Err = err
return
}
diff --git a/api/team_test.go b/api/team_test.go
index 1b1b555fe..5720f71d7 100644
--- a/api/team_test.go
+++ b/api/team_test.go
@@ -79,6 +79,10 @@ func TestAddUserToTeam(t *testing.T) {
t.Fatal("ids didn't match")
}
}
+
+ if _, err := th.BasicClient.GetTeamMember(th.BasicTeam.Id, user2.Id); err != nil {
+ t.Fatal(err)
+ }
}
func TestRemoveUserFromTeam(t *testing.T) {