Permalink
Browse files

Add test

  • Loading branch information...
1 parent fe9b298 commit c91f6ce81c44c2f6c12c0fffed48fecb418e2d19 @jugglinmike jugglinmike committed Dec 21, 2012
Showing with 12 additions and 1 deletion.
  1. +2 −1 grunt.js
  2. +10 −0 test/backbone.search_test.js
View
@@ -53,7 +53,8 @@ module.exports = function(grunt) {
globals: {
module: true,
equal: true,
- test: true
+ test: true,
+ ok: true
}
},
source: {
@@ -14,4 +14,14 @@
equal(typeof this.coll.search, "function");
});
+ test("Returns correct matches", 3, function() {
+
+ var results = this.coll.search("co");
+
+ equal(results.length, 2);
+ ok(results.get(this.coll.at(0)));
+ ok(results.get(this.coll.at(2)));
+
+ });
+
}(this, this.jQuery, this.Backbone, this._));

0 comments on commit c91f6ce

Please sign in to comment.