diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-03-21 18:43:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 18:43:16 -0400 |
commit | bea49cbcf3605a6cab28bc54be41d59d7b627f38 (patch) | |
tree | 5a8f62eee5f19a99b50d8daaefe860a0142c5538 /api4/user_test.go | |
parent | fd6e2f3f73c1fbdda49e4f32d0e40e8d7230518b (diff) | |
download | chat-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.go | 17 |
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() |