summaryrefslogtreecommitdiffstats
path: root/api/user_test.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-09-16 15:49:12 -0400
committerJoramWilander <jwawilander@gmail.com>2015-09-16 15:49:12 -0400
commit47e6a33a4505e13ba4edf37ff1f8fbdadb279ee3 (patch)
tree9d798d908b3a76d6e228f39872e74cccfc27ad35 /api/user_test.go
parent7e418714bce067172e527359f391943459b3bd48 (diff)
downloadchat-47e6a33a4505e13ba4edf37ff1f8fbdadb279ee3.tar.gz
chat-47e6a33a4505e13ba4edf37ff1f8fbdadb279ee3.tar.bz2
chat-47e6a33a4505e13ba4edf37ff1f8fbdadb279ee3.zip
Implement OAuth2 service provider functionality.
Diffstat (limited to 'api/user_test.go')
-rw-r--r--api/user_test.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/api/user_test.go b/api/user_test.go
index fe5a4a27f..986365bd0 100644
--- a/api/user_test.go
+++ b/api/user_test.go
@@ -68,7 +68,7 @@ func TestCreateUser(t *testing.T) {
}
}
- if _, err := Client.DoPost("/users/create", "garbage"); err == nil {
+ if _, err := Client.DoApiPost("/users/create", "garbage"); err == nil {
t.Fatal("should have been an error")
}
}
@@ -190,11 +190,11 @@ func TestSessions(t *testing.T) {
for _, session := range sessions {
if session.DeviceId == deviceId {
- otherSession = session.AltId
+ otherSession = session.Id
}
- if len(session.Id) != 0 {
- t.Fatal("shouldn't return sessions")
+ if len(session.Token) != 0 {
+ t.Fatal("shouldn't return session tokens")
}
}
@@ -212,11 +212,6 @@ func TestSessions(t *testing.T) {
if len(sessions2) != 1 {
t.Fatal("invalid number of sessions")
}
-
- if _, err := Client.RevokeSession(otherSession); err != nil {
- t.Fatal(err)
- }
-
}
func TestGetUser(t *testing.T) {
@@ -355,7 +350,7 @@ func TestUserCreateImage(t *testing.T) {
Client.LoginByEmail(team.Name, user.Email, "pwd")
- Client.DoGet("/users/"+user.Id+"/image", "", "")
+ Client.DoApiGet("/users/"+user.Id+"/image", "", "")
if utils.IsS3Configured() && !utils.Cfg.ServiceSettings.UseLocalStorage {
var auth aws.Auth
@@ -453,7 +448,7 @@ func TestUserUploadProfileImage(t *testing.T) {
t.Fatal(upErr)
}
- Client.DoGet("/users/"+user.Id+"/image", "", "")
+ Client.DoApiGet("/users/"+user.Id+"/image", "", "")
if utils.IsS3Configured() && !utils.Cfg.ServiceSettings.UseLocalStorage {
var auth aws.Auth