summaryrefslogtreecommitdiffstats
path: root/api4/user_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-03-21 18:43:16 -0400
committerGitHub <noreply@github.com>2017-03-21 18:43:16 -0400
commitbea49cbcf3605a6cab28bc54be41d59d7b627f38 (patch)
tree5a8f62eee5f19a99b50d8daaefe860a0142c5538 /api4/user_test.go
parentfd6e2f3f73c1fbdda49e4f32d0e40e8d7230518b (diff)
downloadchat-bea49cbcf3605a6cab28bc54be41d59d7b627f38.tar.gz
chat-bea49cbcf3605a6cab28bc54be41d59d7b627f38.tar.bz2
chat-bea49cbcf3605a6cab28bc54be41d59d7b627f38.zip
Add ability to use 'me' in place of user id for APIv4 (#5826)
Diffstat (limited to 'api4/user_test.go')
-rw-r--r--api4/user_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/api4/user_test.go b/api4/user_test.go
index 2e1a0adc2..923caa761 100644
--- a/api4/user_test.go
+++ b/api4/user_test.go
@@ -75,6 +75,23 @@ func TestCreateUser(t *testing.T) {
}
}
+func TestGetMe(t *testing.T) {
+ th := Setup().InitBasic()
+ defer TearDown()
+ Client := th.Client
+
+ ruser, resp := Client.GetMe("")
+ CheckNoError(t, resp)
+
+ if ruser.Id != th.BasicUser.Id {
+ t.Fatal("wrong user")
+ }
+
+ Client.Logout()
+ _, resp = Client.GetMe("")
+ CheckUnauthorizedStatus(t, resp)
+}
+
func TestGetUser(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer TearDown()