Updated tests

This commit is contained in:
Henry 2016-04-11 17:10:35 -07:00
parent 2fe7ba982f
commit 519a9333ab

View File

@ -58,16 +58,25 @@ define(
expect(policy.allow(mockAction, context)).toBe(true);
});
it('Allows no actions when navigated object in edit mode, but' +
' selected object not in edit mode ', function() {
it('Allows "window" action when navigated object in edit mode,' +
' but selected object not in edit mode ', function() {
navigatedObject.hasCapability.andReturn(true);
metadata.key = "window";
expect(policy.allow(mockAction, context)).toBe(true);
});
it('Disallows "move" action when navigated object in edit mode,' +
' but selected object not in edit mode ', function() {
navigatedObject.hasCapability.andReturn(true);
metadata.key = "move";
expect(policy.allow(mockAction, context)).toBe(false);
});
it('Disallows blacklisted actions when navigated object and' +
it('Disallows copy action when navigated object and' +
' selected object in edit mode', function() {
navigatedObject.hasCapability.andReturn(true);
mockDomainObject.hasCapability.andReturn(true);
metadata.key = "copy";
expect(policy.allow(mockAction, context)).toBe(false);
});