Skip to content
Snippets Groups Projects
Commit fb19ba5a authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

:white_check_mark: Adding tests in region, state and city for the search functionality

Related: simcaq/SCRUM#210 !31
parent 17b92c03
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!31Issue/210: Rota para pesquisa de localidade
Pipeline #
......@@ -70,4 +70,18 @@ describe('request cities', () => {
done();
})
})
it('should search for Curitiba', (done) => {
chai.request(server)
.get('/api/v1/city?search=name:curitiba')
.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('pk_cod_ibge');
res.body.result[0].should.have.property('nome');
done();
});
});
});
......@@ -53,4 +53,19 @@ describe('request regions', () => {
done();
});
});
it('shoul search for south region', (done) => {
chai.request(server)
.get('/api/v1/region?search=name:sul')
.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.should.have.length(1);
res.body.result[0].should.have.property('pk_regiao_id');
res.body.result[0].should.have.property('nome');
done();
});
});
});
......@@ -71,4 +71,20 @@ describe('request states', () => {
done();
});
});
it('should search for Paraná', (done) => {
chai.request(server)
.get('/api/v1/state?search=name:paran')
.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.should.have.length(1);
res.body.result[0].should.have.property('pk_estado_id');
res.body.result[0].should.have.property('fk_regiao_id');
res.body.result[0].should.have.property('nome');
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