mirror of
https://github.com/signaller-matrix/signaller.git
synced 2024-12-22 08:51:50 +00:00
Move user test
This commit is contained in:
parent
f0d2ea7f17
commit
b27c537374
@ -87,21 +87,3 @@ func TestLogout(t *testing.T) {
|
||||
|
||||
user.Logout(token)
|
||||
}
|
||||
|
||||
func TestLogoutWithWrongToken(t *testing.T) {
|
||||
backend := NewBackend("localhost")
|
||||
|
||||
var (
|
||||
userName = "user1"
|
||||
password = "password1"
|
||||
)
|
||||
|
||||
user, _, err := backend.Register(userName, password, "")
|
||||
assert.Nil(t, err)
|
||||
|
||||
token, err := backend.Login(userName, password, "")
|
||||
assert.Nil(t, err)
|
||||
assert.NotZero(t, token)
|
||||
|
||||
user.Logout("worng token")
|
||||
}
|
||||
|
@ -80,3 +80,21 @@ func TestGetUserByWrongToken(t *testing.T) {
|
||||
gotUser := backend.GetUserByToken("wrong token")
|
||||
assert.Nil(t, gotUser)
|
||||
}
|
||||
|
||||
func TestLogoutWithWrongToken(t *testing.T) {
|
||||
backend := NewBackend("localhost")
|
||||
|
||||
var (
|
||||
userName = "user1"
|
||||
password = "password1"
|
||||
)
|
||||
|
||||
user, _, err := backend.Register(userName, password, "")
|
||||
assert.Nil(t, err)
|
||||
|
||||
token, err := backend.Login(userName, password, "")
|
||||
assert.Nil(t, err)
|
||||
assert.NotZero(t, token)
|
||||
|
||||
user.Logout("worng token")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user