message: Add tests for testing inverse relationships population on addRecord
diff: @@ -158,6 +158,37 @@ module('SyncRecordCache', function(hooks) {
  );
  });
  + test('#patch updates inverse hasOne relationship when a record is added', function(assert) {
  + const cache = new Cache({ schema, keyMap });
  +
  + const jupiter: Record = { type: 'planet', id: 'p1', attributes: { name: 'Jupiter' }, relationships: { moons: { data: [{ type: 'moon', id: 'm1' }] } } };
  + const io: Record = { type: 'moon', id: 'm1', attributes: { name: 'Io' }};
  +
  + cache.patch(t => [
  + t.addRecord(jupiter),
  + t.addRecord(io)
  + ]);
  +
  + assert.deepEqual(cache.getRecordSync({ type: 'planet', id: 'p1' }).relationships.moons.data , [{ type: 'moon', id: 'm1' }], 'Jupiter has been assigned to Io');
  + assert.deepEqual(cache.getRecordSync({ type: 'moon', id: 'm1' }).relationships.planet.data, { type: 'planet', id: 'p1' }, 'Io has been assigned to Jupiter');
  + });
  +
  +
  + test('#patch updates inverse hasMany relationship when a record is added', function(assert) {
  + const cache = new Cache({ schema, keyMap });
  +
  + const jupiter: Record = { type: 'planet', id: 'p1', attributes: { name: 'Jupiter' } };
  + const io: Record = { type: 'moon', id: 'm1', attributes: { name: 'Io' }, relationships: { planet: { data: { type: 'planet', id: 'p1'} } } };
  +
  + cache.patch(t => [
  + t.addRecord(jupiter),
  + t.addRecord(io)
  + ]);
  +
  + assert.deepEqual(cache.getRecordSync({ type: 'planet', id: 'p1' }).relationships.moons.data , [{ type: 'moon', id: 'm1' }], 'Jupiter has been assigned to Io');
  + assert.deepEqual(cache.getRecordSync({ type: 'moon', id: 'm1' }).relationships.planet.data, { type: 'planet', id: 'p1' }, 'Io has been assigned to Jupiter');
  + });
  +
  test('#patch tracks refs and clears them from hasOne relationships when a referenced record is removed', function(assert) {
  const cache = new Cache({ schema, keyMap });
  