[Pkg-javascript-commits] [backbone] 47/173: Test case for model.id

Jonas Smedegaard dr at jones.dk
Wed Aug 31 07:44:00 UTC 2016


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

js pushed a commit to branch master
in repository backbone.

commit 7fb6f489661382738a7245c0e7b08f90c607e930
Author: Justin Ridgewell <justin at ridgewell.name>
Date:   Mon Nov 2 10:50:59 2015 -0500

    Test case for model.id
---
 test/model.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/model.js b/test/model.js
index d832c23..e095652 100644
--- a/test/model.js
+++ b/test/model.js
@@ -1400,4 +1400,14 @@
     model.set({a: true});
   });
 
+  QUnit.test('#3778 - id will only be updated if it is set', function(assert) {
+    assert.expect(2);
+    var model = new Backbone.Model({id: 1});
+    model.id = 2;
+    model.set({foo: 'bar'});
+    assert.equal(model.id, 2);
+    model.set({id: 3});
+    assert.equal(model.id, 3);
+  });
+
 })();

-- 
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