mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Move identity map into the store, shouldn't have been in the adapter
This commit is contained in:
24
test/javascripts/models/rest-model-test.js.es6
Normal file
24
test/javascripts/models/rest-model-test.js.es6
Normal file
@ -0,0 +1,24 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user