UNPKG

@bigtest/mirage

Version:

A client-side server to develop, test and prototype your app.

23 lines (18 loc) 565 B
import Helper, { states } from './_helper'; import { module, test } from 'qunit'; module('Integration | ORM | Belongs To | Named Reflexive | delete', { beforeEach() { this.helper = new Helper(); } }); states.forEach((state) => { test(`deleting the parent updates the child's foreign key for a ${state}`, function(assert) { let [ user, bestFriend ] = this.helper[state](); if (bestFriend) { bestFriend.destroy(); user.reload(); } assert.equal(user.bestFriendId, null); assert.deepEqual(user.bestFriend, null); }); });