Permalink
Browse files

Add failing test case for deleting newly added records

  • Loading branch information...
1 parent 742a18a commit 95324ee9b2c53ae64e68830a88a411c7fe9c5ec1 @joliss joliss committed with May 3, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 packages/ember-data/tests/unit/record_array_test.js
@@ -72,6 +72,18 @@ test("a newly created record is removed from a record array when it is deleted",
});
});
+test("a newly created record is removed from a collection when it is deleted", function() {
+ var store = DS.Store.create({ adapter: null }),
+ Group = DS.Model.extend({ people: DS.hasMany('Person') }),
+ group;
+
+ group = store.createRecord(Group);
+ group.get('people').pushObject(store.createRecord(Person));
+ equal(group.get('people').get('length'), 1, "length is 1 after adding record");
+ group.get('people').objectAt(0).deleteRecord();
+ equal(group.get('people').get('length'), 0, "length is 0 after deleting record");
+});
+
test("a record array can have a filter on it", function() {
var store = DS.Store.create();

0 comments on commit 95324ee

Please sign in to comment.