Moved markPMSRead to common.ops. Added tests

This commit is contained in:
Keith Holliday
2016-05-09 09:02:55 -05:00
parent c88cae4ddb
commit a92359e119
8 changed files with 47 additions and 11 deletions

View File

@@ -0,0 +1,22 @@
import {
generateUser,
} from '../../../../helpers/api-integration/v3';
describe('POST /user/mark-pms-read', () => {
let user;
beforeEach(async () => {
user = await generateUser();
});
// More tests in common code unit tests
it('marks user\'s private messages as read', async () => {
await user.update({
'inbox.newMessages': 1,
});
let res = await user.post('/user/mark-pms-read');
await user.sync();
expect(user.inbox.newMessages).to.equal(0);
});
});