|
|
|
@ -541,6 +541,25 @@ describe('[Users]', function() { |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//DEPRECATED
|
|
|
|
|
// TODO: Remove this after three versions have been released. That means at 0.66 this should be gone.
|
|
|
|
|
describe('[/user.roles]', () => { |
|
|
|
|
|
|
|
|
|
it('should return id and name of user, and an array of roles', (done) => { |
|
|
|
|
request.get(api('user.roles')) |
|
|
|
|
.set(credentials) |
|
|
|
|
.expect(200) |
|
|
|
|
.expect('Content-Type', 'application/json') |
|
|
|
|
.expect((res) => { |
|
|
|
|
expect(res.body).to.have.property('username'); |
|
|
|
|
expect(res.body).to.have.property('roles').and.to.be.a('array'); |
|
|
|
|
expect(res.body).to.have.property('_id'); |
|
|
|
|
expect(res.body).to.have.property('success', true); |
|
|
|
|
}) |
|
|
|
|
.end(done); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('[/users.setPreferences]', () => { |
|
|
|
|
it('should set some preferences by user when execute successfully', (done) => { |
|
|
|
|
preferences.userId = credentials['X-User-Id']; |
|
|
|
|