Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
controller.changePassword test
Browse files Browse the repository at this point in the history
  • Loading branch information
RusAlex committed May 6, 2016
1 parent 95f1a6f commit bea9049
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/integration/api.js
Expand Up @@ -231,6 +231,24 @@ describe('api v.1', () => {
});
});

describe('Change password', () => {
it('/user/password should work', async () => {
await expect(
{
url: `/api/v1/user/password`,
session: sessionId,
method: 'POST',
body: {old_password: 'secret', new_password: 'barsecret'}
}
, 'to open successfully');
await user.refresh();
expect(
await bcryptAsync.compareAsync('barsecret', user.get('hashed_password')),
'to be true'
);
});
});

describe('Posts', () => {
let post;

Expand Down

0 comments on commit bea9049

Please sign in to comment.