Convert Composer to use Store

- Uses store for `PostStream`, `TopicList` too
This commit is contained in:
Robin Ward
2015-04-08 14:44:44 -04:00
parent a83a19f6ce
commit d4a05825da
23 changed files with 507 additions and 393 deletions

View File

@ -1,6 +1,21 @@
module('rest-model');
import createStore from 'helpers/create-store';
import RestModel from 'discourse/models/rest';
test('munging', function() {
const store = createStore();
const Grape = RestModel.extend();
Grape.reopenClass({
munge: function(json) {
json.inverse = 1 - json.percent;
return json;
}
});
var g = Grape.create({ store, percent: 0.4 });
equal(g.get('inverse'), 0.6, 'it runs `munge` on `create`');
});
test('update', function() {
const store = createStore();