0
votes

In my ember integration tests I'm getting this error:

Assertion failed: An adapter cannot assign a new id to a record that already has an id. had id: fixture-0 and you tried to update it with null. This likely happened because your server returned data in response to a find or update that had a different id than the one you sent.

1

1 Answers

0
votes

I had set the ApplicationSerializer up to map the primaryKey to "_id" as follows:

Encompass.ApplicationSerializer = DS.RESTSerializer.extend({
  primaryKey: "_id"
});

The fixture data was using "id" so when it went to save it, it didn't see an "_id" come back it coerced the undefined id, to null and tried to update that.

Wrapping that ApplicationSerializer assignment in an

if(window.TESTING) 

resolved it for me