fix(carte): gracefully ignore invalid year and kind params
Empêche d'envoyer une date invalide à PG et polluer les logs.
This commit is contained in:
parent
40e952e8d2
commit
3d52601155
5 changed files with 31 additions and 29 deletions
|
@ -18,5 +18,13 @@ describe CarteController do
|
|||
get :show, params: { map_filter: { year: 2020 } }
|
||||
expect(subject.stats['75']).to eq({ nb_demarches: 1, nb_dossiers: 20 })
|
||||
end
|
||||
|
||||
it 'gracefully ignore invalid params' do
|
||||
get :show, params: { map_filter: { year: "not!" } }
|
||||
expect(subject.stats['75']).to eq({ nb_demarches: 2, nb_dossiers: 50 })
|
||||
|
||||
get :show, params: { map_filter: { kind: "nimp" } }
|
||||
expect(subject.stats['75']).to eq({ nb_demarches: 2, nb_dossiers: 50 })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue