From baccd005dce30f8153cdcf2496d0afa1898a8461 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 21 Mar 2016 15:08:27 -0700 Subject: [PATCH] [Add] Update persistence capability spec ...to reflect removal of cached domain object models. --- .../test/capabilities/PersistenceCapabilitySpec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/platform/core/test/capabilities/PersistenceCapabilitySpec.js b/platform/core/test/capabilities/PersistenceCapabilitySpec.js index 5b46ca3890..d9b93c9e12 100644 --- a/platform/core/test/capabilities/PersistenceCapabilitySpec.js +++ b/platform/core/test/capabilities/PersistenceCapabilitySpec.js @@ -36,6 +36,7 @@ define( mockDomainObject, mockIdentifier, mockNofificationService, + mockCacheService, mockQ, id = "object id", model, @@ -81,6 +82,10 @@ define( "notificationService", ["error"] ); + mockCacheService = jasmine.createSpyObj( + "cacheService", + [ "get", "put", "remove", "all" ] + ); mockDomainObject = { getId: function () { return id; }, @@ -96,6 +101,7 @@ define( mockIdentifierService.parse.andReturn(mockIdentifier); mockIdentifier.getSpace.andReturn(SPACE); persistence = new PersistenceCapability( + mockCacheService, mockPersistenceService, mockIdentifierService, mockNofificationService, @@ -170,6 +176,11 @@ define( expect(mockQ.reject).not.toHaveBeenCalled(); expect(mockNofificationService.error).not.toHaveBeenCalled(); }); + + it("removes the model from the cache", function () { + persistence.persist(); + expect(mockCacheService.remove).toHaveBeenCalledWith(id); + }); }); describe("unsuccessful persistence", function() { var sadPromise = {