mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
use hash literal directly
This will make it harder to forget to instantiate the model.
This commit is contained in:
@@ -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");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user