[Pkg-javascript-commits] [backbone] 04/23: refine the isNew test

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:00:43 UTC 2014


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

js pushed a commit to tag 0.5.1
in repository backbone.

commit 4595b48ffb6a7d743c441ba1008fd84f2c7f854a
Author: Matt Smith <matthewgarysmith at gmail.com>
Date:   Thu Mar 3 17:35:09 2011 -0500

    refine the isNew test
---
 test/model.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/model.js b/test/model.js
index b7eeea7..1fc5987 100644
--- a/test/model.js
+++ b/test/model.js
@@ -92,12 +92,12 @@ $(document).ready(function() {
   });
 
   test("Model: isNew", function() {
-    a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
-    ok(a.isNew(), "it should be new");
-    a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3, 'id': 2 });
-    ok(!a.isNew(), "any defined ID is legal, positive integer");
-    a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3, 'id': -5 });
-    ok(!a.isNew(), "any defined ID is legal, negative integer");
+    a = new Backbone.Model({ });
+    ok(a.isNew(), "is true when there is no id");
+    a = new Backbone.Model({ 'id': 2 });
+    ok(!a.isNew(), "is false for a positive integer");
+    a = new Backbone.Model({ 'id': -5 });
+    ok(!a.isNew(), "is false for a negative integer");
   });
 
   test("Model: get", function() {

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