Permalink
Browse files

test with comparator

  • Loading branch information...
1 parent a6d421c commit 34465b0205971ef500956e609c98ad3860260c1e Alex Graul committed Jun 11, 2012
Showing with 8 additions and 7 deletions.
  1. +8 −7 test/unit/views.js
View
@@ -545,15 +545,16 @@ module("Views :: Syncing");
] },
strict: true
});
-
- ds.comparator = function(r1, r2) {
- if (r1.one > r2.one) {return 1;}
- if (r1.one < r2.one) {return -1;}
- return 0;
- };
+
+
_.when(ds.fetch()).then(function(){
- ds.sort({ silent : true });
+ ds.sort({ silent : true, comparator : function(r1, r2) {
+ if (r1.one > r2.one) {return 1;}
+ if (r1.one < r2.one) {return -1;}
+ return 0;
+ }
+ });
ok(_.isEqual(ds._columns[1].data, [2,3,3,4,10,14]),ds._columns[1].data);
ok(_.isEqual(ds._columns[2].data, [5,6,1,1,4,1]) ,ds._columns[2].data);

0 comments on commit 34465b0

Please sign in to comment.