mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-29 18:46:23 -05:00
24 lines
557 B
JavaScript
24 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);
|
|
});
|
|
});
|
|
});
|
|
|