From 8e3c5db3bfa07a0618a3e4550863b5862b540d10 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 2 Dec 2015 14:14:04 -0800 Subject: [PATCH] #338 fixed incorrect 'allow' function specification in CreationPolicy --- platform/commonUI/browse/src/creation/CreationPolicy.js | 2 +- .../commonUI/browse/test/creation/CreationPolicySpec.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/platform/commonUI/browse/src/creation/CreationPolicy.js b/platform/commonUI/browse/src/creation/CreationPolicy.js index a30a78ab8b..0ccf82d907 100644 --- a/platform/commonUI/browse/src/creation/CreationPolicy.js +++ b/platform/commonUI/browse/src/creation/CreationPolicy.js @@ -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"); } }; diff --git a/platform/commonUI/browse/test/creation/CreationPolicySpec.js b/platform/commonUI/browse/test/creation/CreationPolicySpec.js index 41afee0875..1f88c1b149 100644 --- a/platform/commonUI/browse/test/creation/CreationPolicySpec.js +++ b/platform/commonUI/browse/test/creation/CreationPolicySpec.js @@ -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(); }); }); }