Tweak sort test a bit.

This commit is contained in:
Brad Dunbar
2012-12-01 07:46:01 -05:00
parent 59850645e6
commit 0b2225655b

View File

@@ -716,16 +716,13 @@ $(document).ready(function() {
});
test("`sort` shouldn't always fire on `add`", 1, function() {
var c = new Backbone.Collection([{id: 1},{id: 2},{id: 3}], {
var c = new Backbone.Collection([{id: 1}, {id: 2}, {id: 3}], {
comparator: 'id'
});
c.sort = function() {
ok(1);
return Backbone.Collection.prototype.sort.apply(this, arguments);
}
c.sort = function(){ ok(true); };
c.add([]);
c.add({id: 1});
c.add([{id: 2},{id: 3}]);
c.add([{id: 2}, {id: 3}]);
c.add({id: 4});
});