[Pkg-javascript-commits] [backbone] 02/281: Test for unset attributes not being returned by changedAttributes

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:01:50 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.9.0
in repository backbone.

commit 5310996d09a8b5772e0a0810a327575f02d3a42a
Author: Steve Mason <stevem at brandwatch.com>
Date:   Thu Aug 11 08:53:42 2011 +0100

    Test for unset attributes not being returned by changedAttributes
---
 test/model.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/model.js b/test/model.js
index 7ad0d71..bfb499e 100644
--- a/test/model.js
+++ b/test/model.js
@@ -170,6 +170,14 @@ $(document).ready(function() {
     equals(i, 2, 'Unset does not fire an event for missing attributes.');
   });
 
+  test("Model: unset and changedAttributes", function() {
+    var model = new Backbone.Model({a: 1});
+    model.unset('a', {silent: true});
+    var changedAttributes = model.changedAttributes();
+    ok('a' in changedAttributes, 'changedAttributes should contain unset properties');
+    equals(changedAttributes.a, undefined);
+  });
+
   test("Model: using a non-default id attribute.", function() {
     var MongoModel = Backbone.Model.extend({idAttribute : '_id'});
     var model = new MongoModel({id: 'eye-dee', _id: 25, title: 'Model'});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list