[Persistence] Add test cases

Adds test cases for TransactionalPersistenceCapability which brings
coverage up to 100%.
This commit is contained in:
Victor Woeltjen 2016-07-14 16:22:25 -07:00
parent 7c865f87be
commit 11a2fbacb4

View File

@ -92,6 +92,18 @@ define(
expect(mockPersistence.refresh).toHaveBeenCalled();
});
it("wraps getSpace", function () {
mockPersistence.getSpace.andReturn('foo');
expect(capability.getSpace()).toEqual('foo');
});
it("clears transactions and delegates refresh calls", function () {
capability.refresh();
expect(mockTransactionManager.clearTransactionsFor)
.toHaveBeenCalledWith(mockDomainObject);
expect(mockPersistence.refresh)
.toHaveBeenCalled();
});
});
}