Skip to content

v2.13.3

Compare
Choose a tag to compare
@danielspaniel danielspaniel released this 10 Jun 17:07
· 376 commits to master since this release
  • fixes mockFindRecord('modelName').returns({json}) when the json payload was a plain javascript object.
    • sometimes you just want to throw some plain json into the returns, and not a build('modelName') payload. And that was not working

Example:

// usually you would do this
let json = build('user', {name: 'Bob'});
let mock = mockFindRecord('modelName').returns({json});
mock.get('id') //=> 1 

// but if you did this: 
let json = {data: {id: 1, type: 'user', attributes: { name: 'Bob' }}}; // your own custom payload
let mock = mockFindRecord('modelName').returns({json});
mock.get('id') //=>  thew exception