Skip to content

Instantly share code, notes, and snippets.

@olivierchatry
Last active February 11, 2016 11:28
Show Gist options
  • Select an option

  • Save olivierchatry/ec27691030082d95d05f to your computer and use it in GitHub Desktop.

Select an option

Save olivierchatry/ec27691030082d95d05f to your computer and use it in GitHub Desktop.
run(function() {
var post = env.store.createRecord('post', {});
env.store.createRecord('comment', { message: post });
post.get('comments')
.then(function(comments) {
assert.equal(comments.get('length'), 1);
return post.save();
})
.then(function() {
return post.get('comments');
})
.then(function(comments) {
comments.forEach(
function (comment) { console.log(comment) ; }
)
assert.equal(comments.get('length'), 2);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment