我们如何使用 quint 测试使用夹具测试 ember 数据?这是我的测试代码的样子:
/*globals App, getFoodController*/
module('Analytics Unit Test: AnalyticsConfig Controller', {
setup: function () {
AS.Store = DS.Store.extend({
adapter: DS.FixtureAdapter.create({ simulateRemoteResponse: false })
});
AS.AnalyticsRun.FIXTURES = [{
id: 1,
analyticsPlan: "Jane Q. Public",
commandScript: "some script",
analyticsRunParameters: []
}];
}
});
test('Check controller is initialized',function(){
var controller = getAnalyticsConfigController();
ok(controller, 'AnalyticsConfig controller is ok');
});
test('Check data',function(){
var controller = getAnalyticsConfigController();
var store = controller.get('store');
var data;
Ember.run(function () {
data = store.find('analyticsRun',1);
console.log(data);
});
equal(data.length, 1, 'Check data');
});
当我记录数据时,它会返回一个承诺。但是如何测试返回了多少条记录或检查数据?
谢谢,迪