Code review

This commit is contained in:
Xavier J 2015-11-30 17:03:36 +01:00
parent 58f840ac92
commit 141e23a381
18 changed files with 47 additions and 50 deletions

View file

@ -23,7 +23,7 @@ describe CARTO::SGMAP::API do
context 'when geojson exist' do
let(:geojson) { File.read('spec/support/files/geojson/request.json') }
let(:status) { 200 }
let(:body) { File.read('spec/support/files/geojson/response.json') }
let(:body) { 'toto' }
it 'returns response body' do
expect(subject).to eq(body)

View file

@ -10,20 +10,23 @@ describe CARTO::SGMAP::QuartierPrioritaireAdapter do
to_return(status: status, body: body)
end
context 'coordinates ard informed' do
let(:coordinates) { '' }
context 'coordinates are filled' do
let(:coordinates) { '[[2.252728, 43.27151][2.323223, 32.835332]]' }
let(:status) { 200 }
let(:body) { File.read('spec/support/files/geojson/response.json') }
it { expect(subject).to be_a_instance_of(Hash) }
context 'Attributs' do
context 'Attributes' do
let(:qp_code) { 'QP057019' }
it { expect(subject[qp_code][:code]).to eq(qp_code) }
it { expect(subject[qp_code][:nom]).to eq('Hauts De Vallières') }
it { expect(subject[qp_code][:commune]).to eq('Metz') }
it { expect(subject[qp_code][:geometry]).to eq({:type=>"MultiPolygon", :coordinates=>[[[[6.2136923480551, 49.1342109827851], [6.21416055031881, 49.1338823553928]]]]}) }
subject { super()[qp_code] }
it { expect(subject[:code]).to eq(qp_code) }
it { expect(subject[:nom]).to eq('Hauts De Vallières') }
it { expect(subject[:commune]).to eq('Metz') }
it { expect(subject[:geometry]).to eq({:type=>"MultiPolygon", :coordinates=>[[[[6.2136923480551, 49.1342109827851], [6.21416055031881, 49.1338823553928]]]]}) }
end
end