mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Adjust the get user integration test
This commit is contained in:
@@ -4,25 +4,22 @@ import {
|
|||||||
} from '../../helpers/api.helper';
|
} from '../../helpers/api.helper';
|
||||||
|
|
||||||
describe('GET /user', () => {
|
describe('GET /user', () => {
|
||||||
let api, user;
|
let user;
|
||||||
|
|
||||||
beforeEach((done) => {
|
beforeEach(() => {
|
||||||
generateUser().then((usr) => {
|
return generateUser().then((usr) => {
|
||||||
user = usr;
|
user = usr;
|
||||||
api = requester(usr);
|
});
|
||||||
done();
|
|
||||||
}).catch(done);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('gets the user object', (done) => {
|
it('gets the user object', (done) => {
|
||||||
api.get('/user')
|
let api = requester(user);
|
||||||
.then((fetchedUser) => {
|
api.get('/user').then((fetchedUser) => {
|
||||||
expect(fetchedUser._id).to.eql(user._id);
|
expect(fetchedUser._id).to.eql(user._id);
|
||||||
|
expect(fetchedUser.auth.local.username).to.eql(user.auth.local.username);
|
||||||
expect(fetchedUser.todos).to.eql(user.todos);
|
expect(fetchedUser.todos).to.eql(user.todos);
|
||||||
|
expect(fetchedUser.items).to.eql(user.items);
|
||||||
done();
|
done();
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
done(err);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user