split out test for positive and negative ids

This commit is contained in:
Matt Smith
2011-03-03 17:33:19 -05:00
parent 5ebd949c7f
commit 8971361bdc

View File

@@ -94,8 +94,10 @@ $(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 or positive");
ok(!a.isNew(), "any defined ID is legal, negative integer");
});
test("Model: get", function() {