[Persistence] Add test case

Add test case for cache to ensure the same object
instance is given for multiple read calls, as this addresses
WTD-791.
This commit is contained in:
Victor Woeltjen 2015-02-03 15:51:11 -08:00
parent 014fca0494
commit 301d46e60b

View File

@ -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]);
});
});
}
);