[Persistence] Update failing spec

...to reflect changes to the persistence capability, utilizing the
identifierService for consistent interpretation of spaces by id.
This commit is contained in:
Victor Woeltjen 2015-11-10 12:33:52 -08:00
parent 44eb723efb
commit ffdcbece56

View File

@ -31,7 +31,9 @@ define(
describe("The persistence capability", function () {
var mockPersistenceService,
mockIdentifierService,
mockDomainObject,
mockIdentifier,
id = "object id",
model = { someKey: "some value"},
SPACE = "some space",
@ -50,6 +52,14 @@ define(
"persistenceService",
[ "updateObject", "readObject", "createObject", "deleteObject" ]
);
mockIdentifierService = jasmine.createSpyObj(
'identifierService',
[ 'parse', 'generate' ]
);
mockIdentifier = jasmine.createSpyObj(
'identifier',
[ 'getSpace', 'getKey', 'getDefinedSpace' ]
);
mockDomainObject = {
getId: function () { return id; },
getModel: function () { return model; },
@ -61,9 +71,11 @@ define(
model = mutator(model) || model;
}
});
mockIdentifierService.parse.andReturn(mockIdentifier);
mockIdentifier.getSpace.andReturn(SPACE);
persistence = new PersistenceCapability(
mockPersistenceService,
SPACE,
mockIdentifierService,
mockDomainObject
);
});