Skip to content
Snippets Groups Projects
Commit bdb11adf authored by Fernando Erd's avatar Fernando Erd :ok_hand:
Browse files

Add test

parent 66c5f830
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!72Change school count route
Pipeline #
...@@ -39,20 +39,6 @@ describe('request schools count', () => { ...@@ -39,20 +39,6 @@ describe('request schools count', () => {
}); });
}); });
it('should list the rural locations', (done) => {
chai.request(server)
.get('/api/v1/school/rural_location')
.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', (done) => { it('should list the administrative dependencies', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/school/adm_dependency') .get('/api/v1/school/adm_dependency')
...@@ -109,244 +95,6 @@ describe('request schools count', () => { ...@@ -109,244 +95,6 @@ describe('request schools count', () => {
}); });
}); });
it('should list the building school', (done) => {
chai.request(server)
.get('/api/v1/school/building_school')
.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 informatics labs', (done) => {
chai.request(server)
.get('/api/v1/school/informatics_lab')
.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 science labs', (done) => {
chai.request(server)
.get('/api/v1/school/science_lab')
.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 directors room', (done) => {
chai.request(server)
.get('/api/v1/school/directors_room')
.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 teacher room', (done) => {
chai.request(server)
.get('/api/v1/school/teacher_room')
.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 cook room', (done) => {
chai.request(server)
.get('/api/v1/school/cook_room')
.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 playgrounds', (done) => {
chai.request(server)
.get('/api/v1/school/playground')
.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 indor sports court', (done) => {
chai.request(server)
.get('/api/v1/school/indor_sports_court')
.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 nusery', (done) => {
chai.request(server)
.get('/api/v1/school/nusery')
.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 special attendence room', (done) => {
chai.request(server)
.get('/api/v1/school/special_attendence_room')
.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 toilets inside building', (done) => {
chai.request(server)
.get('/api/v1/school/toilet_inside_building')
.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 denpendency pne', (done) => {
chai.request(server)
.get('/api/v1/school/denpendency_pne')
.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 restroom pne', (done) => {
chai.request(server)
.get('/api/v1/school/restroom_pne')
.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 broadband', (done) => {
chai.request(server)
.get('/api/v1/school/broadband')
.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 energy', (done) => {
chai.request(server)
.get('/api/v1/school/energy')
.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 water', (done) => {
chai.request(server)
.get('/api/v1/school/water')
.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 wastepipe', (done) => {
chai.request(server)
.get('/api/v1/school/wastepipe')
.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 education day care child', (done) => { it('should list the education day care child', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/school/education_day_care_child') .get('/api/v1/school/education_day_care_child')
...@@ -431,37 +179,9 @@ describe('request schools count', () => { ...@@ -431,37 +179,9 @@ describe('request schools count', () => {
}); });
}); });
it('should list the reading room', (done) => {
chai.request(server)
.get('/api/v1/school/reading_room')
.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 library and/or reading_room', (done) => {
chai.request(server)
.get('/api/v1/school/library_reading_room')
.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 school with valid dimensions and filters', (done) => { it('should list school with valid dimensions and filters', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/school/count?dims=location,adm_dependency,government_agreement,library,reading_room,library_reading_room') .get('/api/v1/school/count?dims=location,adm_dependency,government_agreement')
.end((err, res) => { .end((err, res) => {
res.should.have.status(200); res.should.have.status(200);
res.should.be.json; res.should.be.json;
...@@ -470,9 +190,6 @@ describe('request schools count', () => { ...@@ -470,9 +190,6 @@ describe('request schools count', () => {
res.body.result[0].should.have.property('location_name'); res.body.result[0].should.have.property('location_name');
res.body.result[0].should.have.property('adm_dependency_name'); res.body.result[0].should.have.property('adm_dependency_name');
res.body.result[0].should.have.property('government_agreement_name'); res.body.result[0].should.have.property('government_agreement_name');
res.body.result[0].should.have.property('library_name');
res.body.result[0].should.have.property('reading_room_name');
res.body.result[0].should.have.property('library_reading_room_name');
res.body.result[0].should.have.property('total'); res.body.result[0].should.have.property('total');
res.body.result[0].should.have.property('year'); res.body.result[0].should.have.property('year');
done(); done();
...@@ -481,7 +198,7 @@ describe('request schools count', () => { ...@@ -481,7 +198,7 @@ describe('request schools count', () => {
it('should list school with valid dimensions and filters', (done) => { it('should list school with valid dimensions and filters', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/school/count?dims=region,state,cook_room&filter=min_year:2015,max_year:2016,city:4106902,indor_sports_court:1') .get('/api/v1/school/count?dims=region,state&filter=min_year:2015,max_year:2016,city:4106902')
.end((err, res) => { .end((err, res) => {
res.should.have.status(200); res.should.have.status(200);
res.should.be.json; res.should.be.json;
...@@ -489,7 +206,6 @@ describe('request schools count', () => { ...@@ -489,7 +206,6 @@ describe('request schools count', () => {
res.body.result.should.be.a('array'); res.body.result.should.be.a('array');
res.body.result[0].should.have.property('region_name'); res.body.result[0].should.have.property('region_name');
res.body.result[0].should.have.property('state_name'); res.body.result[0].should.have.property('state_name');
res.body.result[0].should.have.property('cook_room_name');
res.body.result[0].should.have.property('total'); res.body.result[0].should.have.property('total');
res.body.result[0].should.have.property('year'); res.body.result[0].should.have.property('year');
done(); done();
...@@ -545,7 +261,7 @@ describe('request schools count', () => { ...@@ -545,7 +261,7 @@ describe('request schools count', () => {
it('should list school with valid dimensions and filters of states that have no toilet inside building', (done) => { it('should list school with valid dimensions and filters of states that have no toilet inside building', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/school/count?dims=state&filter=min_year:2015,max_year:2016,toilet_inside_building:0') .get('/api/v1/school/count?dims=state&filter=min_year:2015,max_year:2016,education_begin_elementary_school:0')
.end((err, res) => { .end((err, res) => {
res.should.have.status(200); res.should.have.status(200);
res.should.be.json; res.should.be.json;
...@@ -560,7 +276,7 @@ describe('request schools count', () => { ...@@ -560,7 +276,7 @@ describe('request schools count', () => {
it('should list school with valid dimensions and filters of states with energy and water', (done) => { it('should list school with valid dimensions and filters of states with energy and water', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/school/count?dims=state&filter=min_year:2015,max_year:2016,energy:1,water:1') .get('/api/v1/school/count?dims=state&filter=min_year:2015,max_year:2016,government_agreement:1')
.end((err, res) => { .end((err, res) => {
res.should.have.status(200); res.should.have.status(200);
res.should.be.json; res.should.be.json;
...@@ -573,51 +289,15 @@ describe('request schools count', () => { ...@@ -573,51 +289,15 @@ describe('request schools count', () => {
}); });
}); });
it('should list school with valid dimensions and filters related to library and reading_room of Curitiba', (done) => {
chai.request(server)
.get('/api/v1/school/count?dims=city,library,reading_room,library_reading_room&filter=min_year:2015,max_year:2016,city:4106902')
.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('city_name');
res.body.result[0].should.have.property('library_name');
res.body.result[0].should.have.property('reading_room_name');
res.body.result[0].should.have.property('library_reading_room_name');
res.body.result[0].should.have.property('total');
res.body.result[0].should.have.property('year');
done();
});
});
it('should list school with valid dimensions and filters related to library and reading_room of cities of Paraná', (done) => {
chai.request(server)
.get('/api/v1/school/count?dims=city,library,reading_room,library_reading_room&filter=min_year:2015,max_year:2016,state:41')
.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('city_name');
res.body.result[0].should.have.property('library_name');
res.body.result[0].should.have.property('reading_room_name');
res.body.result[0].should.have.property('library_reading_room_name');
res.body.result[0].should.have.property('total');
res.body.result[0].should.have.property('year');
done();
});
});
it('should list school with dimension rural_location', (done) => { it('should list school with dimension rural_location', (done) => {
chai.request(server) chai.request(server)
.get('/api/v1/school/count?dims=rural_location') .get('/api/v1/school/count?dims=location')
.end((err, res) => { .end((err, res) => {
res.should.have.status(200); res.should.have.status(200);
res.should.be.json; res.should.be.json;
res.body.should.have.property('result'); res.body.should.have.property('result');
res.body.result.should.be.a('array'); res.body.result.should.be.a('array');
res.body.result[0].should.have.property('rural_location_name'); res.body.result[0].should.have.property('location_name');
done(); done();
}); });
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment