Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: emberjs/data
...
head fork: emberjs/data
  • 4 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 26, 2012
tomhuda Clean up Ember.Application ext tests 8ff8336
tomhuda Demonolithize test harness index.html 002a57a
Commits on Jul 27, 2012
tomhuda Prevents redundant adapter `commit` calls
If DS.Transaction doesn't have any dirty records,
don't call the adapter's `commit` method.
d4630cd
tomhuda WIP on decoupling store and adapter tests. fd4b5a7
6 packages/ember-data/lib/system/transaction.js
View
@@ -189,8 +189,10 @@ DS.Transaction = Ember.Object.extend({
this.removeCleanRecords();
- if (adapter && adapter.commit) { adapter.commit(store, commitDetails, relationships); }
- else { throw fmt("Adapter is either null or does not implement `commit` method", this); }
+ if (commitDetails.created.length || commitDetails.updated.length || commitDetails.deleted.length) {
+ if (adapter && adapter.commit) { adapter.commit(store, commitDetails, relationships); }
+ else { throw fmt("Adapter is either null or does not implement `commit` method", this); }
+ }
},
/**
6 packages/ember-data/tests/integration/application_test.js
View
@@ -5,7 +5,7 @@
var app;
-module("Ember.Application extensions", {
+module("Ember.Application Extensions", {
setup: function() {
var Router = Ember.Router.extend({
root: Ember.Route.extend()
@@ -27,13 +27,13 @@ module("Ember.Application extensions", {
}
});
-test("it should inject a store instance into the router", function() {
+test("If a Store property exists on an Ember.Application, it should be instantiated.", function() {
app.initialize();
ok(app.getPath('router.store') instanceof DS.Store, "the store was injected");
});
-test("it should inject the store into instantiated controllers", function() {
+test("If a store is instantiated, it should be made available to each controller.", function() {
app.initialize();
ok(app.getPath('router.fooController.store') instanceof DS.Store, "the store was injected");
2  packages/ember-data/tests/integration/record_persistence_test.js
View
@@ -45,7 +45,7 @@ test("When a store is committed, the adapter's `commit` method should be called
});
test("When a store is committed, the adapter's `commit` method should be called with records that have been created.", function() {
- expect(4);
+ expect(3);
adapter.commit = function(store, records) {
equal(get(records.updated, 'length'), 0, "no records are marked as being updated");
68 packages/ember-data/tests/integration/store_adapter_test.js
View
@@ -33,74 +33,6 @@ module("DS.Store and DS.Adapter integration test", {
}
});
-test("by default, commit calls updateRecords once per type", function() {
- expect(9);
-
- adapter.updateRecords = function(store, type, array) {
- equal(type, Person, "the type is correct");
- equal(get(array, 'length'), 2, "the array is the right length");
-
- array.forEach(function(item) {
- equal(get(item, 'isSaving'), true, "the item is saving");
- });
-
- store.didUpdateRecords(array);
-
- array.forEach(function(item) {
- equal(get(item, 'isSaving'), false, "the item is no longer saving");
- equal(get(item, 'isLoaded'), true, "the item is loaded");
- });
- };
-
- store.load(Person, { id: 1, name: "Braaaahm Dale" });
- store.load(Person, { id: 2, name: "Gentile Katz" });
-
- var tom = store.find(Person, 1);
- var yehuda = store.find(Person, 2);
-
- set(tom, "name", "Tom Dale");
- set(yehuda, "name", "Yehuda Katz");
-
- store.commit();
-
- equal(get(store.find(Person, 2), "name"), "Yehuda Katz", "record was updated");
-
- // there is nothing to commit, so there won't be any records
- store.commit();
-});
-
-test("updateRecords can return an array of Hashes to update the store with", function() {
- expect(8);
-
- adapter.updateRecords = function(store, type, array) {
- equal(type, Person, "the type is correct");
- equal(get(array, 'length'), 2, "the array is the right length");
-
- store.didUpdateRecords(array, [ { id: 1, name: "Tom Dale", updatedAt: "now" }, { id: 2, name: "Yehuda Katz", updatedAt: "now!" } ]);
-
- equal(get(array[0], 'updatedAt'), "now", "the data was inserted");
- equal(get(array[1], 'updatedAt'), "now!", "the data was inserted");
- equal(get(array[0], 'isDirty'), false, "the object is not dirty");
- equal(get(array[1], 'isDirty'), false, "the object is not dirty");
- };
-
- store.load(Person, { id: 1, name: "Braaaahm Dale" });
- store.load(Person, { id: 2, name: "Gentile Katz" });
-
- var tom = store.find(Person, 1);
- var yehuda = store.find(Person, 2);
-
- set(tom, "name", "Tom Dale");
- set(yehuda, "name", "Yehuda Katz");
-
- store.commit();
-
- equal(get(store.find(Person, 1), "name"), "Tom Dale", "record was updated");
- equal(get(store.find(Person, 2), "name"), "Yehuda Katz", "record was updated");
-
- // there is nothing to commit, so there won't be any records
- store.commit();
-});
test("by default, commit calls deleteRecords once per type", function() {
expect(4);
50 packages/ember-data/tests/unit/adapter_test.js
View
@@ -31,38 +31,38 @@ test("The `commit` method should call `createRecords` once per type.", function(
});
});
-test("by default, commit calls updateRecords once per type", function() {
- expect(9);
+test("The `commit` method should call `updateRecords` once per type.", function() {
+ expect(2);
adapter.updateRecords = function(store, type, array) {
- equal(type, Person, "the type is correct");
- equal(get(array, 'length'), 2, "the array is the right length");
-
- array.forEach(function(item) {
- equal(get(item, 'isSaving'), true, "the item is saving");
- });
-
- store.didUpdateRecords(array);
-
- array.forEach(function(item) {
- equal(get(item, 'isSaving'), false, "the item is no longer saving");
- equal(get(item, 'isLoaded'), true, "the item is loaded");
- });
+ equal(type, Person, "the type is Person");
+ equal(get(array, 'length'), 2, "the array has two items");
};
- store.load(Person, { id: 1, name: "Braaaahm Dale" });
- store.load(Person, { id: 2, name: "Gentile Katz" });
+ var tom = Person.create({ name: "Tom Dale", updatedAt: null });
+ var yehuda = Person.create({ name: "Yehuda Katz" });
- var tom = store.find(Person, 1);
- var yehuda = store.find(Person, 2);
+ adapter.commit(storeStub, {
+ updated: [tom, yehuda],
+ deleted: [],
+ created: []
+ });
+});
- set(tom, "name", "Tom Dale");
- set(yehuda, "name", "Yehuda Katz");
+test("The `commit` method should call `deleteRecords` once per type.", function() {
+ expect(2);
- store.commit();
+ adapter.deleteRecords = function(store, type, array) {
+ equal(type, Person, "the type is Person");
+ equal(get(array, 'length'), 2, "the array has two items");
+ };
- equal(get(store.find(Person, 2), "name"), "Yehuda Katz", "record was updated");
+ var tom = Person.create({ name: "Tom Dale", updatedAt: null });
+ var yehuda = Person.create({ name: "Yehuda Katz" });
- // there is nothing to commit, so there won't be any records
- store.commit();
+ adapter.commit(storeStub, {
+ updated: [],
+ deleted: [tom, yehuda],
+ created: []
+ });
});
164 packages/ember-data/tests/unit/store_test.js
View
@@ -599,3 +599,167 @@ test("an ID of 0 is allowed", function() {
equal(store.findAll(Person).objectAt(0).get('name'), "Tom Dale", "found record with id 0");
});
+var StubModel, stubAdapter, store;
+
+var receivedEvent = function(record, event) {
+ return -1 !== record.receivedEvents.indexOf(event);
+};
+
+module("DS.Store - Adapter Callbacks", {
+ setup: function() {
+ StubModel = Ember.Object.extend({
+ init: function() {
+ this.resetEvents();
+ },
+
+ send: function(event) {
+ this.receivedEvents.push(event);
+ },
+
+ resetEvents: function() {
+ this.receivedEvents = [];
+ },
+
+ setupData: Ember.K
+ });
+
+ StubModel.reopenClass({
+ _create: function() {
+ return this.create.apply(this, arguments);
+ }
+ });
+
+ stubAdapter = Ember.Object.create({
+ extractId: function(type, hash) {
+ return hash.id;
+ },
+
+ materialize: function(record, hash) {
+ record.materializedData = hash;
+ }
+ });
+
+ store = DS.Store.create({ adapter: stubAdapter });
+ },
+
+ teardown: function() {
+ stubAdapter.destroy();
+ store.destroy();
+ }
+});
+
+test("An adapter can notify the store that records were updated by calling `didUpdateRecord`.", function() {
+ expect(11);
+
+ var tom, yehuda, transaction;
+
+ stubAdapter.commit = function(store, commitDetails, relationships) {
+ var updatedRecords = commitDetails.updated;
+
+ equal(get(updatedRecords, 'length'), 2, "precond - two updated records are passed to `commit`");
+
+ ok(!receivedEvent(tom, 'didCommit'), "didCommit was not sent");
+ ok(!receivedEvent(yehuda, 'didCommit'), "didCommit was not sent");
+ ok(!receivedEvent(tom, 'didChangeData'), "didChangeData was not sent");
+ ok(!receivedEvent(yehuda, 'didChangeData'), "didChangeData was not sent");
+
+ store.didUpdateRecord(tom, { id: 1, name: "Tom Dale", updatedAt: "now" });
+ store.didUpdateRecord(yehuda, { id: 2, name: "Yehuda Katz", updatedAt: "now!" });
+
+ ok(receivedEvent(tom, 'didCommit'), "didCommit was sent");
+ ok(receivedEvent(yehuda, 'didCommit'), "didCommit was sent");
+ ok(receivedEvent(tom, 'didChangeData'), "didChangeData was sent");
+ ok(receivedEvent(yehuda, 'didChangeData'), "didChangeData was sent");
+
+ store.materializeData(tom);
+ store.materializeData(yehuda);
+
+ deepEqual(tom.materializedData, {
+ id: 1,
+ name: "Tom Dale",
+ updatedAt: "now"
+ }, "hash provided to `didUpdateRecord` for tom replaces the hash provided to `load`");
+
+ deepEqual(yehuda.materializedData, {
+ id: 2,
+ name: "Yehuda Katz",
+ updatedAt: "now!"
+ }, "hash provided to `didUpdateRecord` for yehuda replaces the hash provided to `load`");
+ };
+
+ store.load(StubModel, { id: 1, name: "Braaaahm Dale" });
+ store.load(StubModel, { id: 2, name: "Gentile Katz" });
+
+ tom = store.find(StubModel, 1);
+ yehuda = store.find(StubModel, 2);
+ transaction = tom.get('transaction');
+
+ transaction.recordBecameDirty('updated', tom);
+ transaction.recordBecameDirty('updated', yehuda);
+
+ tom.resetEvents();
+ yehuda.resetEvents();
+
+ store.commit();
+
+ // there is nothing to commit, so there won't be any records
+ store.commit();
+});
+
+test("An adapter can notify the store that multiple records were updated by passing an array to `didUpdateRecords`.", function() {
+ expect(11);
+
+ var tom, yehuda, transaction;
+
+ stubAdapter.commit = function(store, commitDetails, relationships) {
+ var updatedRecords = commitDetails.updated;
+
+ equal(get(updatedRecords, 'length'), 2, "precond - two updated records are passed to `commit`");
+
+ ok(!receivedEvent(tom, 'didCommit'), "didCommit was not sent");
+ ok(!receivedEvent(yehuda, 'didCommit'), "didCommit was not sent");
+ ok(!receivedEvent(tom, 'didChangeData'), "didChangeData was not sent");
+ ok(!receivedEvent(yehuda, 'didChangeData'), "didChangeData was not sent");
+
+ store.didUpdateRecords(updatedRecords, [ { id: 1, name: "Tom Dale", updatedAt: "now" }, { id: 2, name: "Yehuda Katz", updatedAt: "now!" } ]);
+
+ ok(receivedEvent(tom, 'didCommit'), "didCommit was sent");
+ ok(receivedEvent(yehuda, 'didCommit'), "didCommit was sent");
+ ok(receivedEvent(tom, 'didChangeData'), "didChangeData was sent");
+ ok(receivedEvent(yehuda, 'didChangeData'), "didChangeData was sent");
+
+ store.materializeData(tom);
+ store.materializeData(yehuda);
+
+ deepEqual(tom.materializedData, {
+ id: 1,
+ name: "Tom Dale",
+ updatedAt: "now"
+ }, "hash provided to `didUpdateRecords` for tom replaces the hash provided to `load`");
+
+ deepEqual(yehuda.materializedData, {
+ id: 2,
+ name: "Yehuda Katz",
+ updatedAt: "now!"
+ }, "hash provided to `didUpdateRecords` for yehuda replaces the hash provided to `load`");
+ };
+
+ store.load(StubModel, { id: 1, name: "Braaaahm Dale" });
+ store.load(StubModel, { id: 2, name: "Gentile Katz" });
+
+ tom = store.find(StubModel, 1);
+ yehuda = store.find(StubModel, 2);
+ transaction = tom.get('transaction');
+
+ transaction.recordBecameDirty('updated', tom);
+ transaction.recordBecameDirty('updated', yehuda);
+
+ tom.resetEvents();
+ yehuda.resetEvents();
+
+ store.commit();
+
+ // there is nothing to commit, so the adapter's commit method
+ // should not be called again.
+ store.commit();
+});
11 packages/ember-data/tests/unit/transaction_test.js
View
@@ -191,15 +191,7 @@ test("a record that is in the deleted state cannot be moved into a new transacti
});
test("a record that is in the clean state is moved back to the default transaction after its transaction is committed", function() {
- var commitCalled = 0;
-
- var store = DS.Store.create({
- adapter: DS.Adapter.create({
- commit: function() {
- commitCalled++;
- }
- })
- });
+ var store = DS.Store.create();
store.load(Person, { id: 1 });
@@ -209,7 +201,6 @@ test("a record that is in the clean state is moved back to the default transacti
transaction.add(person);
transaction.commit();
- equal(commitCalled, 1, "should attempt to commit records");
equal(get(person, 'transaction'), get(store, 'defaultTransaction'), "record should have been moved back to the default transaction");
});
176 tests/index.html
View
@@ -8,43 +8,11 @@
<script type="text/javascript" src="handlebars-1.0.0.beta.6.js"></script>
<script type="text/javascript" src="minispade.js"></script>
+ <script type="text/javascript" src="qunit_configuration.js"></script>
<script type="text/javascript">
- // Tests should time out after 5 seconds
- QUnit.config.testTimeout = 5000;
-
- // Handle JSHint
- QUnit.config.urlConfig.push('nojshint');
-
- var noJsHint = location.search.match(/nojshint=([^&]+)/);
- jsHint = !(noJsHint && decodeURIComponent(noJsHint[1]));
-
- var jsHintReporter = function (file, errors) {
- if (!errors) { return ''; }
-
- var len = errors.length,
- str = '',
- error, idx;;
-
- if (len === 0) { return ''; }
-
- for (idx=0; idx<len; idx++) {
- error = errors[idx];
- str += file + ': line ' + error.line + ', col ' +
- error.character + ', ' + error.reason + '\n';
- };
-
- return str + "\n" + len + ' error' + ((len === 1) ? '' : 's');
- }
-
-
- // Handle extending prototypes
- QUnit.config.urlConfig.push('extendprototypes');
-
- window.ENV = window.ENV || {};
-
- var extendPrototypes = location.search.match(/extendprototypes=([^&]+)/);
- ENV['EXTEND_PROTOTYPES'] = !!(extendPrototypes && decodeURIComponent(extendPrototypes[1]));
- ENV['TESTING'] = true
+ window.loadScript = function(url) {
+ document.write(unescape('%3Cscript src="'+url+'"%3E%3C/script%3E'));
+ };
</script>
</head>
<body>
@@ -58,7 +26,7 @@ <h2 id="qunit-userAgent"></h2>
<script>
// Load jshint if being used (can cause failurs in old environments if always loaded)
if (jsHint) {
- document.write(unescape('%3Cscript src="jshint.js"%3E%3C/script%3E'));
+ loadScript('jshint.js');
}
// Close the script tag to make sure document.write happens
</script>
@@ -66,9 +34,11 @@ <h2 id="qunit-userAgent"></h2>
<script>
// Load custom version of jQuery if possible
var jQueryMatch = location.search.match(/jquery=([^&]+)/),
- jQueryVersion = jQueryMatch ? jQueryMatch[1] : "1.7.1";
+ jQueryVersion = jQueryMatch ? jQueryMatch[1] : "1.7.1",
+ url = 'http://ajax.googleapis.com/ajax/libs/jquery/'+jQueryVersion+'/jquery.js';
+
if (jQueryVersion !== 'none') {
- document.write(unescape('%3Cscript src="http://ajax.googleapis.com/ajax/libs/jquery/'+jQueryVersion+'/jquery.js"%3E%3C/script%3E'));
+ loadScript(url);
}
// Close the script tag to make sure document.write happens
</script>
@@ -77,116 +47,15 @@ <h2 id="qunit-userAgent"></h2>
// Fallback to default jQuery
if (jQueryVersion !== 'none' && !window.jQuery) {
if (console && console.warn) { console.warn("Unable to load jQuery "+jQueryVersion+". Using default."); }
- document.write(unescape('%3Cscript src="jquery-1.7.1.js"%3E%3C/script%3E'));
+
+ loadScript('jquery-1.7.1.js');
}
</script>
- <script>
- (function() {
- window.Ember = { config: {}, testing: true };
-
- window.async = function(callback, timeout) {
- stop();
-
- timeout = setTimeout(function() {
- start();
- ok(false, "Timeout was reached");
- }, timeout || 100);
-
- return function() {
- clearTimeout(timeout);
-
- start();
- callback.apply(this, arguments);
- };
- };
-
- window.invokeAsync = function(callback, timeout) {
- timeout = timeout || 1;
-
- setTimeout(async(callback, timeout+100), timeout);
- };
-
- var syncForTest = function(fn) {
- var callSuper;
-
- if (typeof fn !== "function") { callSuper = true; }
-
- return function() {
- var override = false, ret;
-
- if (Ember.run && !Ember.run.currentRunLoop) {
- Ember.run.begin();
- override = true;
- }
-
- try {
- if (callSuper) {
- ret = this._super.apply(this, arguments);
- } else {
- ret = fn.apply(this, arguments);
- }
- } finally {
- if (override) {
- Ember.run.end();
- }
- }
-
- return ret;
- }
- }
-
- Ember.config.overrideAccessors = function() {
- Ember.set = syncForTest(Ember.set);
- Ember.get = syncForTest(Ember.get);
- };
-
- Ember.config.overrideClassMixin = function(ClassMixin) {
- ClassMixin.reopen({
- create: syncForTest()
- })
- };
-
- Ember.config.overridePrototypeMixin = function(PrototypeMixin) {
- PrototypeMixin.reopen({
- destroy: syncForTest()
- })
- };
-
- minispade.register('ember-data/~test-setup', function() {
- run = Ember.run;
-
- Ember.View.reopen({
- _insertElementLater: syncForTest()
- });
-
- DS.Store.reopen({
- createRecord: syncForTest(),
- deleteRecord: syncForTest(),
- load: syncForTest(),
- loadMany: syncForTest(),
- filter: syncForTest(),
- find: syncForTest(),
- didCreateRecord: syncForTest(),
- didCreateRecords: syncForTest(),
- didUpdateRecord: syncForTest(),
- didUpdateRecords: syncForTest(),
- });
-
- DS.Model.reopen({
- deleteRecord: syncForTest(),
- dataDidChange: Ember.observer(syncForTest(), 'data')
- });
-
- DS.Transaction.reopen({
- commit: syncForTest(),
- });
- });
- })();
- </script>
+ <script type="text/javascript" src="test_helpers.js"></script>
<script>
- document.write(unescape('%3Cscript src="../dist/modules/ember.js"%3E%3C/script%3E'));
+ loadScript('../dist/modules/ember.js');
</script>
<script>
@@ -202,30 +71,13 @@ <h2 id="qunit-userAgent"></h2>
var emberFile = distros[dist];
if (!emberFile) { throw 'Unknown dist'; }
- document.write(unescape('%3Cscript src="../dist/'+emberFile+'"%3E%3C/script%3E'));
+ loadScript('../dist/'+emberFile);
// Close the script tag to make sure document.write happens
</script>
<script type="text/javascript" src="ember-data-tests.js"></script>
<script type="text/javascript">
-
- // hack qunit to not suck for Ember objects
- var originalTypeof = QUnit.jsDump.typeOf;
-
- QUnit.jsDump.typeOf = function(obj) {
- if (Ember && Ember.Object && Ember.Object.detectInstance(obj)) {
- return "emberObject";
- }
-
- return originalTypeof.call(this, obj);
- };
-
- QUnit.jsDump.parsers.emberObject = function(obj) {
- return obj.toString();
- }
-
-
// Load Tests and Depenencies
var packages = location.search.match(/package=([^&]+)/),
packageName, el, idx, len, re, match, moduleName;
54 tests/qunit_configuration.js
View
@@ -0,0 +1,54 @@
+/*global QUnit*/
+
+(function() {
+ // Tests should time out after 5 seconds
+ QUnit.config.testTimeout = 5000;
+
+ // Handle JSHint
+ QUnit.config.urlConfig.push('nojshint');
+
+ var noJsHint = location.search.match(/nojshint=([^&]+)/);
+ window.jsHint = !(noJsHint && decodeURIComponent(noJsHint[1]));
+
+ window.jsHintReporter = function (file, errors) {
+ if (!errors) { return ''; }
+
+ var len = errors.length,
+ str = '',
+ error, idx;
+
+ if (len === 0) { return ''; }
+
+ for (idx=0; idx<len; idx++) {
+ error = errors[idx];
+ str += file + ': line ' + error.line + ', col ' +
+ error.character + ', ' + error.reason + '\n';
+ }
+
+ return str + "\n" + len + ' error' + ((len === 1) ? '' : 's');
+ };
+
+ // Handle extending prototypes
+ QUnit.config.urlConfig.push('extendprototypes');
+
+ window.Ember = window.Ember || {};
+
+ var extendPrototypes = location.search.match(/extendprototypes=([^&]+)/);
+
+ Ember.EXTEND_PROTOTYPES = !!(extendPrototypes && decodeURIComponent(extendPrototypes[1]));
+
+ // hack qunit to not suck for Ember objects
+ var originalTypeof = QUnit.jsDump.typeOf;
+
+ QUnit.jsDump.typeOf = function(obj) {
+ if (Ember && Ember.Object && Ember.Object.detectInstance(obj)) {
+ return "emberObject";
+ }
+
+ return originalTypeof.call(this, obj);
+ };
+
+ QUnit.jsDump.parsers.emberObject = function(obj) {
+ return obj.toString();
+ };
+})();
104 tests/test_helpers.js
View
@@ -0,0 +1,104 @@
+(function() {
+ window.Ember = window.Ember || {};
+
+ Ember.config = {};
+ Ember.testing = true;
+
+ window.ENV = { TESTING: true };
+
+ window.async = function(callback, timeout) {
+ stop();
+
+ timeout = setTimeout(function() {
+ start();
+ ok(false, "Timeout was reached");
+ }, timeout || 100);
+
+ return function() {
+ clearTimeout(timeout);
+
+ start();
+ callback.apply(this, arguments);
+ };
+ };
+
+ window.invokeAsync = function(callback, timeout) {
+ timeout = timeout || 1;
+
+ setTimeout(async(callback, timeout+100), timeout);
+ };
+
+ var syncForTest = function(fn) {
+ var callSuper;
+
+ if (typeof fn !== "function") { callSuper = true; }
+
+ return function() {
+ var override = false, ret;
+
+ if (Ember.run && !Ember.run.currentRunLoop) {
+ Ember.run.begin();
+ override = true;
+ }
+
+ try {
+ if (callSuper) {
+ ret = this._super.apply(this, arguments);
+ } else {
+ ret = fn.apply(this, arguments);
+ }
+ } finally {
+ if (override) {
+ Ember.run.end();
+ }
+ }
+
+ return ret;
+ };
+ };
+
+ Ember.config.overrideAccessors = function() {
+ Ember.set = syncForTest(Ember.set);
+ Ember.get = syncForTest(Ember.get);
+ };
+
+ Ember.config.overrideClassMixin = function(ClassMixin) {
+ ClassMixin.reopen({
+ create: syncForTest()
+ });
+ };
+
+ Ember.config.overridePrototypeMixin = function(PrototypeMixin) {
+ PrototypeMixin.reopen({
+ destroy: syncForTest()
+ });
+ };
+
+ minispade.register('ember-data/~test-setup', function() {
+ Ember.View.reopen({
+ _insertElementLater: syncForTest()
+ });
+
+ DS.Store.reopen({
+ createRecord: syncForTest(),
+ deleteRecord: syncForTest(),
+ load: syncForTest(),
+ loadMany: syncForTest(),
+ filter: syncForTest(),
+ find: syncForTest(),
+ didCreateRecord: syncForTest(),
+ didCreateRecords: syncForTest(),
+ didUpdateRecord: syncForTest(),
+ didUpdateRecords: syncForTest(),
+ });
+
+ DS.Model.reopen({
+ deleteRecord: syncForTest(),
+ dataDidChange: Ember.observer(syncForTest(), 'data')
+ });
+
+ DS.Transaction.reopen({
+ commit: syncForTest(),
+ });
+ });
+})();

No commit comments for this range

Something went wrong with that request. Please try again.