mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 03:06:54 +00:00
#338 fixed incorrect 'allow' function specification in CreationPolicy
This commit is contained in:
parent
11d8daf3ed
commit
8e3c5db3bf
@ -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");
|
||||
}
|
||||
};
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user