mirror of
https://github.com/discourse/discourse.git
synced 2025-09-08 12:06:51 +08:00
Convert Composer
to use Store
- Uses store for `PostStream`, `TopicList` too
This commit is contained in:
parent
a83a19f6ce
commit
d4a05825da
23 changed files with 507 additions and 393 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue