Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename model_array_test -> record_array_test

  • Loading branch information...
commit a17d6b11a86c96fe4492318664abeca40da0e8f4 1 parent 46f5a9e
Tom Dale authored
View
10 packages/ember-data/tests/unit/model_array_test.js → packages/ember-data/tests/unit/record_array_test.js
@@ -49,18 +49,22 @@ test("a loaded record is removed from a record array when it is deleted", functi
test("a newly created record is removed from a record array when it is deleted", function() {
var store = DS.Store.create({ adapter: null });
+ var recordArray = store.findAll(Person);
+
var scumbag = store.createRecord(Person, {
name: "Scumbag Dale"
});
- var recordArray = store.findAll(Person);
+ var person1 = store.createRecord(Person, { name: 'p1'});
+ var person2 = store.createRecord(Person, { name: 'p2'});
+ var person3 = store.createRecord(Person, { name: 'p3'});
- equal(get(recordArray, 'length'), 1, "precond - record array has the created item");
+ equal(get(recordArray, 'length'), 4, "precond - record array has the created item");
equal(get(recordArray.objectAt(0), 'name'), "Scumbag Dale", "item at index 0 is record with id 1");
scumbag.deleteRecord();
- equal(get(recordArray, 'length'), 0, "record is removed from the record array");
+ equal(get(recordArray, 'length'), 3, "record is removed from the record array");
});
test("a record array can have a filter on it", function() {
Please sign in to comment.
Something went wrong with that request. Please try again.