Skip to content

Commit

Permalink
Created a test for simple groupBy query
Browse files Browse the repository at this point in the history
  • Loading branch information
juzerali committed Nov 17, 2012
1 parent 48bda0d commit 35f66ac
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion test/group-query-test.js
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
//TODO support http://wiki.apache.org/solr/FieldCollapsing?highlight=%28field%29%7C%28collapsing%29
//TODO support http://wiki.apache.org/solr/FieldCollapsing?highlight=%28field%29%7C%28collapsing%29
/**
* Modules dependencies
*/

var mocha = require('mocha'),
assert = require('chai').assert,
libPath = process.env['SOLR_CLIENT_COV'] ? '../lib-cov' : '../lib',
solr = require( libPath + '/solr'),
sassert = require('./sassert');

// Test suite
var client = solr.createClient();


describe('Group',function(){

describe('#groupBy(field), callback)',function(){
it('should return grouped results',function(done){
var query = client.createQuery()
.q({
title_t: 'title1'
})
.groupBy('title_t');
client.search(query, function(err, data){
sassert.ok(err, data);
assert(data.responseHeader.params.group);
assert.equal('title_t', data.responseHeader.params['group.field']);
done();
});
});
});
});

0 comments on commit 35f66ac

Please sign in to comment.