Ich arbeite an meinen Unit-Tests und es fühlt sich an, als ob ich etwas falsch mache. Ich habe ein ‚Haupt‘ Objekt, das viele BeziehungenEmber-Cli-Unit-Tests mit Beziehungen "Bedürfnisse"
author: belongsTo('person', { async: true }),
title: attr('string'),
category: belongsTo('category', { async: true }),
impact: belongsTo('impact', { async: true }),
status: attr('string'),
createdDate: attr('moment'),
submittedDate: attr('moment'),
authorOrg: belongsTo('organization', { async: true }),
locations: hasMany('location', { async: true }),
audits: hasMany('audit', { async: true })
Und jedes Mal, wenn ich die Arbeit an den Unit-Tests für seinen zugehörigen Artikel (person
, category
, impact
) hat, ich habe all die needs
Werte zu reproduzieren das hat mein "Haupt" -Objekt. Es fühlt sich einfach nicht richtig für meine Lage Unit-Test category
müssen, wenn es nur um eine Zeichenfolge für seinen Namen und seine Beziehung zum ‚Haupt‘ Objekt kümmert sich zurück
// location/model-test.js
import {
moduleForModel,
test
} from 'ember-qunit';
moduleForModel('location', 'Location', {
// Specify the other units that are required for this test.
needs: ['model:main', 'model:person', 'model:category',
'model:impact', 'model:organization', 'model:location']
});
Bin ich etwas falsch zu machen oder gibt es eine bessere Möglichkeit, meine Komponententests zu erstellen, um mit den Beziehungen umzugehen?
Ich bin auf glut-cli 0.1.5, 1.9.1 Ember und glut-Daten Beta 14