mardi 7 juillet 2015

Acceptance tests failing due to record inFlight with ember-data 1.13.4

I've just updated ember-data from 1.0-beta-18 to 1.13.4 and fixed all issues except this one that occurs during my acceptance tests when I try to destroy the application in my afterEach.

Error: Assertion Failed: You can only unload a record which is not inFlight. `<frontend@model:user::ember2881:null>`
    at new Error (native)
    at Error.EmberError (http://ift.tt/1S6oM9Y)
    at Object._emberMetalCore.default.assert (http://ift.tt/1S6oMa0)
    at Object.ember$data$lib$system$model$states$$assertAgainstUnloadRecord [as unloadRecord] (http://ift.tt/1HKzX8D)
    at InternalModel.ember$data$lib$system$model$internal$model$$InternalModel.send (http://ift.tt/1S6oKPk)
    at InternalModel.ember$data$lib$system$model$internal$model$$InternalModel.unloadRecord (http://ift.tt/1HKzX8J)
    at ember$data$lib$system$store$$Service.extend.unloadAll (http://ift.tt/1S6oMqm)
    at Array.forEach (native)
    at ember$data$lib$system$store$$Service.extend.unloadAll (http://ift.tt/1HKzX8N)
    at ember$data$lib$system$store$$Service.extend.willDestroy (http://ift.tt/1S6oKPo)

When I deactivate a route in the application I do a user.save() which causes a xhr to go out, and is triggering this failure on the application destroy. Removing the user.save(). I have tried updating to the latest ember-cli-qunit and ember-qunit with no luck.

My afterEach looks like the following -

afterEach: function () {
    Ember.run(application, 'destroy');
    ajaxMock.shutdown();
}

Prior to the upgrade this was not an issue. How can I fix or work around this issue?

Aucun commentaire:

Enregistrer un commentaire