Skip to content

Commit

Permalink
[test] Add test for keys query
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Oct 3, 2012
1 parent 8611bad commit 8e05ce6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/couchdb-filter-test.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ vows.describe('resourceful/resource/view').addBatch({
assert.equal(res.length,1); assert.equal(res.length,1);
assert.equal(res[0].author,'yoda'); 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')
);
}
} }
} }
} }
Expand Down

0 comments on commit 8e05ce6

Please sign in to comment.