diff --git a/gulpfile.babel.js b/gulpfile.babel.js index a6eb1a87542d7067ca8e822b5bced23b203a712a..11e9416f87c8528c84d0bbb64f5312c8455215b4 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -75,7 +75,7 @@ gulp.task('pre-test', () => { gulp.task('test', ['pre-test'], () => { process.chdir('build'); gulp.src(['test/**/*.js'], {read: false}) - .pipe(mocha({timeout: 30000})) + .pipe(mocha({timeout: 60000})) .pipe(istanbul.writeReports()) .pipe(istanbul.enforceThresholds({ thresholds: { diff --git a/src/test/enrollment.js b/src/test/enrollment.js index 3c19f29e7151761cef04fdbc692202d6bba3f949..48bebc5f0beaa7883e618f3a9d64004f023f9e1c 100644 --- a/src/test/enrollment.js +++ b/src/test/enrollment.js @@ -68,7 +68,63 @@ describe('request enrollments', () => { it('should list the administrative dependencies', (done) => { chai.request(server) - .get('/api/v1/enrollment/adm_dependency ') + .get('/api/v1/enrollment/adm_dependency_detailed') + .end((err, res) => { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property('result'); + res.body.result.should.be.a('array'); + res.body.result[0].should.have.property('id'); + res.body.result[0].should.have.property('name'); + done(); + }); + }); + + it('should list the administrative dependencies detailed', (done) => { + chai.request(server) + .get('/api/v1/enrollment/adm_dependency') + .end((err, res) => { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property('result'); + res.body.result.should.be.a('array'); + res.body.result[0].should.have.property('id'); + res.body.result[0].should.have.property('name'); + done(); + }); + }); + + it('should list genders', (done) => { + chai.request(server) + .get('/api/v1/enrollment/gender') + .end((err, res) => { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property('result'); + res.body.result.should.be.a('array'); + res.body.result[0].should.have.property('id'); + res.body.result[0].should.have.property('name'); + done(); + }); + }); + + it('should list the ethnic groups', (done) => { + chai.request(server) + .get('/api/v1/enrollment/ethnic_group') + .end((err, res) => { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property('result'); + res.body.result.should.be.a('array'); + res.body.result[0].should.have.property('id'); + res.body.result[0].should.have.property('name'); + done(); + }); + }); + + it('should list the periods', (done) => { + chai.request(server) + .get('/api/v1/enrollment/period') .end((err, res) => { res.should.have.status(200); res.should.be.json; @@ -155,7 +211,7 @@ describe('request enrollments', () => { it('should list enrollments with valid dimensions and filters', (done) => { chai.request(server) - .get('/api/v1/enrollment?dims=region,state,education_level,school&filter=min_year:2015,max_year:2015,city:4106902') + .get('/api/v1/enrollment?dims=region,state,education_level,school,gender,period&filter=min_year:2015,max_year:2015,city:4106902') .end((err, res) => { res.should.have.status(200); res.should.be.json;