jeudi 19 mars 2015

Why do I have to 'need' all models when testing models in ember

I have three entities Token - N:1 - User - N:1 - Company. I let ember-cli to generate model tests and all of them failed. Thats somehow expected, since when testing Token it should need User so I added user into needs. Whats misery for me is why do I have to include Company as well? Will I have to include all of my models in every model test?



// tests/unit/models/token-test.js
import {moduleForModel, test} from 'ember-qunit';
moduleForModel('token', {
needs: ['model:user', 'model:company']
});

test('it exists', function(assert) {
var model = this.subject();
// var store = this.store();
assert.ok(!!model);
});




Aucun commentaire:

Enregistrer un commentaire