discourse/test/javascripts/models/rest-model-test.js.es6

25 lines
557 B
JavaScript

module('rest-model');
import createStore from 'helpers/create-store';
test('update', function() {
const store = createStore();
store.find('widget', 123).then(function(widget) {
equal(widget.get('name'), 'Trout Lure');
widget.update({ name: 'new name' }).then(function() {
equal(widget.get('name'), 'new name');
});
});
});
test('destroyRecord', function() {
const store = createStore();
store.find('widget', 123).then(function(widget) {
widget.destroyRecord().then(function(result) {
ok(result);
});
});
});