mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Adjust stying of put test
This commit is contained in:
@@ -5,23 +5,19 @@ import {
|
|||||||
|
|
||||||
describe('PUT /user', () => {
|
describe('PUT /user', () => {
|
||||||
let api, user;
|
let api, user;
|
||||||
|
|
||||||
beforeEach((done) => {
|
beforeEach(() => {
|
||||||
generateUser().then((usr) => {
|
return generateUser().then((usr) => {
|
||||||
user = usr;
|
user = usr;
|
||||||
api = requester(usr);
|
api = requester(user);
|
||||||
done();
|
|
||||||
}).catch(done);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates the user", () => {
|
|
||||||
let api = requester(user);
|
|
||||||
return api.get('/user')
|
|
||||||
.then((fetchedUser) => {
|
|
||||||
return api.put("/user", {"profile.name" : "Frodo"});
|
|
||||||
})
|
|
||||||
.then((updatedUser) => {
|
|
||||||
expect(updatedUser.profile.name).to.eql("Frodo");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
it('updates the user', () => {
|
||||||
|
return api.put('/user', {
|
||||||
|
'profile.name' : 'Frodo',
|
||||||
|
}).then((updatedUser) => {
|
||||||
|
expect(updatedUser.profile.name).to.eql('Frodo');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user