Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moduleForModel leaking state between tests #194

Closed
pwfisher opened this issue Sep 30, 2015 · 2 comments
Closed

moduleForModel leaking state between tests #194

pwfisher opened this issue Sep 30, 2015 · 2 comments

Comments

@pwfisher
Copy link

this.subject() is not giving me a fresh object for each test.

http://jsbin.com/wafigo/edit?js,output

@rwjblue
Copy link
Member

rwjblue commented Sep 30, 2015

You are sharing a mutable object ('[]') on the model prototype, as you have it in the JSBin this is shared across all instances.

You need something like:

init: function() {
  this._super.apply(this, arguments);
  this.messages = [];
}

@pwfisher
Copy link
Author

Another pair of eyes made it a shallow bug. Thanks!

messages: () => { return []; }.property(),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants