mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 19:42:32 -05:00
25 lines
557 B
Text
25 lines
557 B
Text
|
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);
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
|