Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a test to check that the record gets notified on ID change

  • Loading branch information...
commit 692fe196d6785a8521633ded3b7e1d562432f346 1 parent 9c3fdbb
@enyo enyo authored Charles Jolley committed
Showing with 13 additions and 1 deletion.
  1. +13 −1 frameworks/datastore/tests/system/store/core_methods.js
View
14 frameworks/datastore/tests/system/store/core_methods.js
@@ -138,6 +138,18 @@ test("Make sure that setting an attribute on a record will only notify respectiv
file.writeAttribute('name', 'My Great New Name');
SC.RunLoop.end();
- equals(Application._nameDidChange, 1, 'observer was only fired once');
+ equals(Application._nameDidChange, 1, 'observer should have been fired only once');
});
+
+
+test("Calling replaceIdFor() should notify the record that its id has changed", function() {
+
+ var file = store.find(Application.File, '14');
+
+ SC.Store.replaceIdFor(file.get('storeKey'), 999);
+
+ equals(file.get('id'), 999, 'the record should have the new id');
+
+});
+
Please sign in to comment.
Something went wrong with that request. Please try again.