2016-12-01 19:07:11 +01:00
|
|
|
describe '/user/get-user' do
|
|
|
|
|
2021-11-05 21:06:08 +01:00
|
|
|
Scripts.logout()
|
2016-12-01 19:07:11 +01:00
|
|
|
result = request('/user/login', {
|
2021-11-11 21:17:39 +01:00
|
|
|
email: $staff[:email],
|
|
|
|
password: $staff[:password],
|
2016-12-01 19:07:11 +01:00
|
|
|
staff: true
|
|
|
|
})
|
|
|
|
|
|
|
|
$csrf_userid = result['data']['userId']
|
|
|
|
$csrf_token = result['data']['token']
|
|
|
|
|
|
|
|
it 'should get user data' do
|
|
|
|
result = request('/user/get-user', {
|
|
|
|
userId: 4,
|
|
|
|
csrf_userid: $csrf_userid,
|
|
|
|
csrf_token: $csrf_token
|
|
|
|
})
|
|
|
|
|
|
|
|
(result['status']).should.equal('success')
|
|
|
|
|
|
|
|
user = $database.getRow('user', 4 , 'id')
|
|
|
|
(user['email']).should.equal(result['data']['email'])
|
2020-05-13 07:51:51 +02:00
|
|
|
(user['signup_date']).should.equal(result['data']['signupDate'].to_i)
|
2016-12-01 19:07:11 +01:00
|
|
|
(user['name']).should.equal(result['data']['name'])
|
|
|
|
end
|
|
|
|
|
2020-12-26 23:13:59 +01:00
|
|
|
end
|