Sha256: 2427b9d90ac18387c51e4929f3db11ec75efc3b36cc2c28c1cb20332a38bde20

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

describe("Kojac Operations", function() {

	beforeEach(function () {
		this.cache = Ember.Object.create();
		var factory = new Kojac.ObjectFactory();
		this.kojac = new Kojac.Core({
			cache: this.cache,
			remoteProvider: new Kojac.RemoteProvider({useMockFileValues: true, mockFilePath: 'mockjson/'}),
			objectFactory: factory
		});
	});

	it("try reading order_item,product,order_item__50", function() {
		var op;
		var req;
		runs(function() {
			req = this.kojac.read('order_item').read('product').read('order_item__50');
			expect(req).toBeDefined('ops');
			expect(req).toBeDefined('options');
			expect(req.ops.length).toEqual(3);
			op = req.ops[0];
			expect(op.verb).toEqual('READ');
			expect(op.key).toEqual('order_item');
			expect(op.result_key).toEqual(op.key);
			expect(op.results).toEqual({});
			op = req.ops[1];
			expect(op.verb).toEqual('READ');
			expect(op.key).toEqual('product');
			expect(op.result_key).toEqual(op.key);
			expect(op.results).toEqual({});
			op = req.ops[2];
			expect(op.verb).toEqual('READ');
			expect(op.key).toEqual('order_item__50');
			expect(op.result_key).toEqual(op.key);
			expect(op.results).toEqual({});
		});
	});
});



Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kojac-0.9.1 spec/kojac_operations_spec.js
kojac-0.9.0.1 spec/kojac_operations_spec.js
kojac-0.9.0 spec/kojac_operations_spec.js