Permissions authorization middleware.

This commit is contained in:
Ahmed Bouhuolia
2019-09-16 01:08:19 +02:00
parent ed4d37c8fb
commit de905d7e7c
23 changed files with 318 additions and 51 deletions

View File

@@ -1,4 +1,4 @@
import { request, expect } from '~/testInit';
import { request, expect, create } from '~/testInit';
describe('routes: `/accountOpeningBalance`', () => {
describe('POST `/accountOpeningBalance`', () => {
@@ -40,5 +40,16 @@ describe('routes: `/accountOpeningBalance`', () => {
type: 'NOT_FOUND_ACCOUNT', code: 100, ids: [100],
});
});
it('Should store the given credit and debit to the account balance in the storage.', async () => {
const account = await create('account');
const res = await request().post('/api/accountOpeningBalance').send({
accounts: [
{ id: account.id, credit: 100, debit: 2 },
],
});
console.log(res.status);
});
});
});