Add carto import api

takes a FeatureCollection to import and returns an augmented champ FeatureCollection
This commit is contained in:
Paul Chavard 2020-05-07 12:06:42 +02:00
parent f4677a0907
commit 4f2e504cc2
3 changed files with 45 additions and 4 deletions

View file

@ -73,6 +73,28 @@ describe Champs::CarteController, type: :controller do
it { expect(response.status).to eq 204 }
end
describe 'POST #import' do
render_views
let(:params) do
{
champ_id: champ.id,
feature_collection: {
features: [feature]
}
}
end
before do
post :import, params: params
end
it {
expect(response.status).to eq 201
expect(response.body).to include("bbox")
}
end
describe 'GET #index' do
render_views