[API] composition providers receive new-style objects
Ensure that composition providers get new-style objects (with id included) so that they can properly check for applicability.
This commit is contained in:
@@ -50,7 +50,7 @@ define(
|
||||
this.capabilityService = capabilityService;
|
||||
}
|
||||
|
||||
QueuingPersistenceCapabilityDecorator.prototype.getCapabilities = function (model) {
|
||||
QueuingPersistenceCapabilityDecorator.prototype.getCapabilities = function (model, id) {
|
||||
var capabilityService = this.capabilityService,
|
||||
persistenceQueue = this.persistenceQueue;
|
||||
|
||||
@@ -76,7 +76,7 @@ define(
|
||||
}
|
||||
|
||||
return decoratePersistence(
|
||||
capabilityService.getCapabilities(model)
|
||||
capabilityService.getCapabilities(model, id)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ define(
|
||||
mockPersistence,
|
||||
mockDomainObject,
|
||||
testModel,
|
||||
testId,
|
||||
decorator;
|
||||
|
||||
beforeEach(function () {
|
||||
@@ -41,6 +42,7 @@ define(
|
||||
['getCapabilities']
|
||||
);
|
||||
testModel = { someKey: "some value" };
|
||||
testId = 'someId';
|
||||
mockPersistence = jasmine.createSpyObj(
|
||||
'persistence',
|
||||
['persist', 'refresh']
|
||||
@@ -67,9 +69,9 @@ define(
|
||||
// QueuingPersistenceCapability itself, which has its own tests.
|
||||
|
||||
it("delegates to its wrapped service", function () {
|
||||
decorator.getCapabilities(testModel);
|
||||
decorator.getCapabilities(testModel, testId);
|
||||
expect(mockCapabilityService.getCapabilities)
|
||||
.toHaveBeenCalledWith(testModel);
|
||||
.toHaveBeenCalledWith(testModel, testId);
|
||||
});
|
||||
|
||||
it("wraps its persistence capability's constructor", function () {
|
||||
|
||||
Reference in New Issue
Block a user