diff --git a/platform/persistence/cache/test/CachingPersistenceDecoratorSpec.js b/platform/persistence/cache/test/CachingPersistenceDecoratorSpec.js index 9f2758a99d..4088fda79e 100644 --- a/platform/persistence/cache/test/CachingPersistenceDecoratorSpec.js +++ b/platform/persistence/cache/test/CachingPersistenceDecoratorSpec.js @@ -77,6 +77,17 @@ define( }); + it("gives a single instance of cached objects", function () { + // Perform two reads + decorator.readObject(testSpace, "someKey", "someValue") + .then(mockCallback); + decorator.readObject(testSpace, "someKey", "someValue") + .then(mockCallback); + + // Results should have been pointer-identical + expect(mockCallback.calls[0].args[0]) + .toBe(mockCallback.calls[1].args[0]); + }); }); } ); \ No newline at end of file