私はember.jsアプリを持っていて、次のように設定していDS.Store
ます(実際のコードを表示):
(function (app) {
'use strict';
...
var store = DS.Store.extend({
revision: 12
});
app.Store = store;
})(window.Balanced);
これでqunitテストがあり、そのテストでデフォルトのRESTAdapterをFixtureAdapterに交換して、モデルのフィクスチャをセットアップできるようにします。私はこのようなものを書く必要があると思いますが、100%確信はありません:
(function () {
'use strict';
var fixtureAdapter;
module('tests.store.module', {
setup: function () {
fixtureAdapter = DS.FixtureAdapter.extend({
});
Balanced.Store.reopen({
adapter: fixtureAdapter
});
// TODO: how does this work?
Balanced.Marketplace.FIXTURES = [
{id: 1, name: '1'},
{id: 2, name: 'poop'},
{id: 3, name: 'poop'}
];
},
teardown: function () {
// teardown code
}
}
);
test("Marketplace query", function () {
var marketplaces = Balanced.Marketplace.find();
// TODO: how do I test this?
});
})();