Updated gh-user-can-admin unit test
no issue - helper now calls `.get('isOwnerOrAdmin')` rather than `.get('admin')` or `.get('owner')`
This commit is contained in:
parent
313ff0b669
commit
d6d98ba5ca
@ -4,29 +4,10 @@ import {ghUserCanAdmin} from 'ghost-admin/helpers/gh-user-can-admin';
|
||||
|
||||
describe('Unit: Helper: gh-user-can-admin', function () {
|
||||
// Mock up roles and test for truthy
|
||||
describe('Owner role', function () {
|
||||
describe('Owner or admin roles', function () {
|
||||
let user = {
|
||||
get(role) {
|
||||
if (role === 'isOwner') {
|
||||
return true;
|
||||
} else if (role === 'isAdmin') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
it(' - can be Admin', function () {
|
||||
let result = ghUserCanAdmin([user]);
|
||||
expect(result).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Administrator role', function () {
|
||||
let user = {
|
||||
get(role) {
|
||||
if (role === 'isOwner') {
|
||||
return false;
|
||||
} else if (role === 'isAdmin') {
|
||||
if (role === 'isOwnerOrAdmin') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user