From 36e12d5185a41f024dd041276d0bcf879aa4c52a Mon Sep 17 00:00:00 2001 From: Vytor Calixto <vytorcalixto@gmail.com> Date: Wed, 14 Mar 2018 09:44:31 -0300 Subject: [PATCH] Update tests --- src/libs/routes/distributionFactor.js | 4 ++-- src/libs/routes/rateSchool.js | 6 +++--- src/test/infrastructure.js | 6 +++--- src/test/siope.js | 15 --------------- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/libs/routes/distributionFactor.js b/src/libs/routes/distributionFactor.js index 5cd08eba..df4d84b7 100644 --- a/src/libs/routes/distributionFactor.js +++ b/src/libs/routes/distributionFactor.js @@ -161,7 +161,7 @@ distributionApp.get('/', rqf.parse(), (req, res, next) => { let result = []; let first = true; req.enrollmentFactor.forEach((city) => { - if(first) console.log(city); + // if(first) console.log(city); let obj = { level: city.nivel, region_id: city.regiao_id, @@ -172,7 +172,7 @@ distributionApp.get('/', rqf.parse(), (req, res, next) => { city_name: city.city_name, series: [] }; - if(first) console.log(obj); + // if(first) console.log(obj); first = false; relation.forEach((serie) => { obj.series.push({ diff --git a/src/libs/routes/rateSchool.js b/src/libs/routes/rateSchool.js index 883fd3de..85601322 100644 --- a/src/libs/routes/rateSchool.js +++ b/src/libs/routes/rateSchool.js @@ -241,8 +241,8 @@ function matchQueries(queryTotal, queryPartial) { keys.forEach((key) => { newObj[key] = result[key]; }); - console.log('NEW OBJ'); - console.log(newObj); + // console.log('NEW OBJ'); + // console.log(newObj); let index = keys.indexOf('total'); if(index > -1) keys.splice(index, 1); let objMatch = null; @@ -264,7 +264,7 @@ function matchQueries(queryTotal, queryPartial) { } if(objMatch) { - console.log(objMatch); + // console.log(objMatch); newObj.denominator = result.total; newObj.partial = objMatch.total; newObj.total = (objMatch.total / result.total) * 100; diff --git a/src/test/infrastructure.js b/src/test/infrastructure.js index 38dee0e2..c92fda1e 100644 --- a/src/test/infrastructure.js +++ b/src/test/infrastructure.js @@ -23,7 +23,7 @@ const libs = `${process.cwd()}/libs`; const server = require(`${libs}/app`); chai.use(chaiHttp); -describe('request idhme', () => { +describe('request infrastructure', () => { it('should list default query infrastructure', (done) => { chai.request(server) .get('/api/v1/infrastructure') @@ -63,9 +63,9 @@ describe('request idhme', () => { }); }); - it('should list the locations detailed', (done) => { + it('should list the rural locations', (done) => { chai.request(server) - .get('/api/v1/infrastructure/location_detailed') + .get('/api/v1/infrastructure/rural_location') .end((err, res) => { res.should.have.status(200); res.should.be.json; diff --git a/src/test/siope.js b/src/test/siope.js index cc28caf5..ac13ead5 100644 --- a/src/test/siope.js +++ b/src/test/siope.js @@ -67,21 +67,6 @@ describe('request siope', () => { }); }); - it('should list siope with valid filters', (done) => { - chai.request(server) - .get('/api/v1/siope?filter=max_year:2013') - .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('year'); - res.body.result[0].should.have.property('state_id'); - res.body.result[0].should.have.property('fundeb'); - done(); - }); - }); - it('should list siope with valid dimensions', (done) => { chai.request(server) .get('/api/v1/siope?dims=state') -- GitLab