#338 fixed incorrect 'allow' function specification in CreationPolicy

This commit is contained in:
Henry 2015-12-02 14:14:04 -08:00
parent 11d8daf3ed
commit 8e3c5db3bf
2 changed files with 4 additions and 5 deletions

View File

@ -38,7 +38,7 @@ define(
* Only allow creation of object types that have the
* Creation capability
*/
allow: function (action, type) {
allow: function (type) {
return type.hasFeature("creation");
}
};

View File

@ -27,8 +27,7 @@ define(
"use strict";
describe("The creation policy", function () {
var mockDomainObject,
mockType,
var mockType,
policy;
beforeEach(function () {
@ -42,12 +41,12 @@ define(
it("allows creation of types with the creation feature", function () {
mockType.hasFeature.andReturn(true);
expect(policy.allow({}, mockType)).toBeTruthy();
expect(policy.allow(mockType)).toBeTruthy();
});
it("disallows creation of types without the creation feature", function () {
mockType.hasFeature.andReturn(false);
expect(policy.allow({}, mockType)).toBeFalsy();
expect(policy.allow(mockType)).toBeFalsy();
});
});
}