use hash literal directly

This will make it harder to forget to instantiate the model.
This commit is contained in:
Matt Smith
2011-03-03 17:20:38 -05:00
parent 13acb8a822
commit 5ebd949c7f

View File

@@ -92,11 +92,9 @@ $(document).ready(function() {
});
test("Model: isNew", function() {
attrs = { 'foo': 1, 'bar': 2, 'baz': 3};
a = new Backbone.Model(attrs);
a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
ok(a.isNew(), "it should be new");
attrs = { 'foo': 1, 'bar': 2, 'baz': 3, 'id': -5 };
a = new Backbone.Model(attrs);
a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3, 'id': -5 });
ok(!a.isNew(), "any defined ID is legal, negative or positive");
});