Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[test] Add test for `keys` query

  • Loading branch information...
commit 8e05ce610ac8b354dd2de8c610855fe8e3a821de 1 parent 8611bad
Maciej Małecki mmalecki authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/couchdb-filter-test.js
15 test/couchdb-filter-test.js
View
@@ -94,6 +94,21 @@ vows.describe('resourceful/resource/view').addBatch({
assert.equal(res.length,1);
assert.equal(res[0].author,'yoda');
}
+ },
+ "<by> ['yoda', 'fitzgerald']": {
+ topic: function (Article) {
+ Article.by({
+ keys: ['yoda', 'fitzgerald']
+ }, this.callback);
+ },
+ "should return an array of Article records by 'yoda' or 'fitzgerald'": function (e, res) {
+ assert.isArray(res);
+ assert.equal(res.length, 2);
+ assert(
+ (res[0].author === 'yoda' && res[1].author === 'fitzgerald') ||
+ (res[0].author === 'fitzgerald' && res[1].author === 'yoda')
+ );
+ }
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.