UPDATE: Actually, doing this with `reopen` is apparently deprecated. Back to creating actual objects for relationships -_-
don't do this below stuff
Stubbing relationships in model unit tests
// model
export default DS.Model.extend({
addonService: DS.belongsTo('addon-service')
});
// unit test setup that does NOT work
beforeEach(function () {
addon = this.store().createRecord('addon', {
addonService: Ember.Object.create({
name: 'addon-service-name'
})
});
});
// unit test setup that works
beforeEach(function () {
addon = this.store().createRecord('addon');
addon.reopen({
addonService: Ember.Object.create({
name: 'addon-service-name'
})
});
});
Actually, doing this with
reopen
is apparently deprecated.Back to creating actual objects for relationships -_-