Add carto import api
takes a FeatureCollection to import and returns an augmented champ FeatureCollection
This commit is contained in:
parent
f4677a0907
commit
4f2e504cc2
3 changed files with 45 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue