Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
Joan Sanchez 2018-08-07 12:49:03 +02:00
commit 065dc745e6
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
const app = require(`${servicesDir}/client/server/server`);
describe('loopback model Account', () => {
it('should return true if the user has the given role', async() => {
let result = await app.models.Account.hasRole(1, 'employee');
expect(result).toBeTruthy();
});
it('should return false if the user doesnt have the given role', async() => {
let result = await app.models.Account.hasRole(1, 'administrator');
expect(result).toBeFalsy();
});
});