Skip to content

Instantly share code, notes, and snippets.

@danfinlay
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save danfinlay/4ea194e23843a0bede12 to your computer and use it in GitHub Desktop.

Select an option

Save danfinlay/4ea194e23843a0bede12 to your computer and use it in GitHub Desktop.
Problematic Unit Test in Ember needs some kind of Ember.run() application.
test('Post has a user', function() {
expect(1);
var store = this.container.lookup('store:main');
var Post = this.container.lookupFactory('model:post');
var User = this.container.lookupFactory('model:user');
var user = store.createRecord('user', {name:"Bob"});
var post = store.createRecord('post', {
body:"Hey!",
user: user
});
ok(post.get('user.name') === user.get('name'), 'Post user is set correctly.");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment