spec/kojac_mock_spec.js in kojac-0.9.1 vs spec/kojac_mock_spec.js in kojac-0.11.0
- old
+ new
@@ -11,11 +11,11 @@
var Product = Kojac.Object.extend({
});
beforeEach(function () {
- App.cache = new Kojac.Object();
+ App.cache = new Kojac.Cache();
var factory = new Kojac.ObjectFactory();
factory.register([
[/^order_item(__|$)/,OrderItem],
[/^product(__|$)/,Product]
]);
@@ -193,21 +193,21 @@
expect(op.results.order_item__54).toBeUndefined();
expect(App.cache.order_item__54).toBeUndefined();
});
});
- it("try executing", function() {
+ it("try executing, should not be cached", function() {
var op;
var req;
App.kojac.remoteProvider.mockReadOperationHandler = function(aOp) {
op.result_key = op.key;
op.results = {
results: [1,2,3]
};
};
runs(function() {
- req = App.kojac.executeRequest('results',{a: 1,b:2},{cacheResults: true});
+ req = App.kojac.executeRequest('results',{a: 1,b:2});
expect(req).toBeDefined('ops');
expect(req).toBeDefined('options');
expect(req.ops.length).toEqual(1);
op = req.ops[0];
expect(op.verb).toEqual('EXECUTE');
@@ -221,10 +221,10 @@
expect(req.ops).toBeDefined();
op = req.ops[0];
expect(op.result_key).toEqual(op.key);
expect(typeof(op.results)).toBe('object');
expect(op.results.results).toEqual([1,2,3]);
- expect(App.cache.results).toEqual([1,2,3]);
+ expect(App.cache.results).toBeUndefined();
});
});
});