Skip to content

Node.js based forum software built for the modern web

fix tests and mongo method

barisusakli03ee52412195
diff --git a/src/database/mongo/sorted.js b/src/database/mongo/sorted.js
index c61e748a14..603b1ab770 100644
--- a/src/database/mongo/sorted.js
+++ b/src/database/mongo/sorted.js
@@ -153,7 +153,7 @@ module.exports = function(db, module) {
};
module.getSortedSetRangeByScoreWithScores = function(key, start, count, min, max, callback) {
- getSortedSetRangeByScore(key, start, count, min, max, -1, true, callback);
+ getSortedSetRangeByScore(key, start, count, min, max, 1, true, callback);
};
module.getSortedSetRevRangeByScoreWithScores = function(key, start, count, max, min, callback) {
diff --git a/tests/database/sorted.js b/tests/database/sorted.js
index eceec0bc38..c00bd2a392 100644
--- a/tests/database/sorted.js
+++ b/tests/database/sorted.js
@@ -118,7 +118,7 @@ describe('Sorted Set methods', function() {
describe('getSortedSetRevRangeByScore()', function() {
it('should get count elements with score between max min sorted by score highest to lowest', function(done) {
- db.getSortedSetRevRangeByScore('sorted2', 0, -1, '+inf', 1, function(err, values) {
+ db.getSortedSetRevRangeByScore('sorted2', 0, -1, '+inf', 2, function(err, values) {
assert.equal(err, null);
assert.equal(arguments.length, 2);
assert.deepEqual(values, ['value3', 'value2']);