Implement PUT /users/sessions/device endpoint for APIv4 (#5866)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
84dc60a640
Коммит
d145c35838
@@ -1275,7 +1275,36 @@ func TestRevokeSessions(t *testing.T) {
|
||||
|
||||
_, resp = th.SystemAdminClient.RevokeSession(th.SystemAdminUser.Id, session.Id)
|
||||
CheckNoError(t, resp)
|
||||
}
|
||||
|
||||
func TestAttachDeviceId(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
defer TearDown()
|
||||
Client := th.Client
|
||||
|
||||
deviceId := model.PUSH_NOTIFY_APPLE + ":1234567890"
|
||||
pass, resp := Client.AttachDeviceId(deviceId)
|
||||
CheckNoError(t, resp)
|
||||
|
||||
if !pass {
|
||||
t.Fatal("should have passed")
|
||||
}
|
||||
|
||||
if sessions, err := app.GetSessions(th.BasicUser.Id); err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
if sessions[0].DeviceId != deviceId {
|
||||
t.Fatal("Missing device Id")
|
||||
}
|
||||
}
|
||||
|
||||
_, resp = Client.AttachDeviceId("")
|
||||
CheckBadRequestStatus(t, resp)
|
||||
|
||||
Client.Logout()
|
||||
|
||||
_, resp = Client.AttachDeviceId("")
|
||||
CheckUnauthorizedStatus(t, resp)
|
||||
}
|
||||
|
||||
func TestGetUserAudits(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user