From bea9049b26f2e5be8c30967b6d3905ca19baa896 Mon Sep 17 00:00:00 2001 From: Alexander Pletnev Date: Fri, 6 May 2016 13:24:52 +0000 Subject: [PATCH] controller.changePassword test --- test/integration/api.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/integration/api.js b/test/integration/api.js index 621676f9..7b175653 100644 --- a/test/integration/api.js +++ b/test/integration/api.js @@ -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;