Presence of an acceptance test breaks my unit tests


#1

I have a strange problem, here’s how to reproduce.

Using ember-cli 0.44, create a new app, and generate a user and address model. They each belongsTo each other.

Then, write a unit test for the address that looks like this:

test('it has a user', function() {
  var model = this.subject();
  var store = this.store();

  Ember.run(function() {
    var user = store.createRecord('user');
    model.set('user', user);

    ok(true);
  });
});

adding needs: ['model:user'] to the test. The test passes.

Now, type ember g acceptance-test index. The unit tests break for the model, right on the model.set line:

Assertion Failed: You can only add a ‘user’ record to this relationship

It doesn’t matter what’s in the acceptance test, just the fact that it exists is enough to break the unit tests.

Any ideas what’s going on?


#2

50 rep on SO up for grabs: http://stackoverflow.com/questions/25857424/acceptance-test-breaks-my-model-unit-test-suite-ember-cli-0-44