[Entanglement] Verify revalidation

Verify that move/copy/link revalidate when performed and
throw errors when moving/copying/linking would be invalid.
nasa/openmctweb#98
This commit is contained in:
Victor Woeltjen
2015-09-22 15:49:22 -07:00
parent 6996883b85
commit 4743833f7c
3 changed files with 36 additions and 0 deletions

View File

@@ -285,6 +285,20 @@ define(
});
});
it("throws an expection when performed on invalid inputs", function () {
var copyService =
new CopyService(mockQ, creationService, policyService);
function perform() {
copyService.perform(object, newParent);
}
policyService.allow.andReturn(true);
expect(perform).not.toThrow();
policyService.allow.andReturn(false); // Cause validate to fail
expect(perform).toThrow();
});
});
});
}