Julian Simioni
bc8eabe4e6
Remove loops and many global checks from sanitiser tests
...
Modifying these sanitiser tests became extremely hard because almost all
of them were looping over lots of individual test cases, which places
assumptions about the common behavior of potentialy very different test
cases, as well as making assertions about huge swaths of output when
only a small amount of that output was really under test.
Hopefully these changes will make our tests easier to modify, and not
really lose any ability to catch bugs.
9 years ago
Julian Simioni
82d3a6603c
Store sanitised types from layers parameter
...
This moves the list of types created by sanitising the layer API
parameter from clean.layers to clean.types.from_layers. In subsequent
commits, types created from address parsing, and the
yet-to-be-implemented source parameter will also live in the clean.types
object.
This will allow moving logic to set cmd.type out of controllers, and
into separate logic that can be a littler smarter. Also, it will no
longer require the clean.default_layers_set flag to be passed all around
like a nasty global variable.
9 years ago
Diana Shkolnikov
db0e063d8c
Refactor controllers to be simple midddleware
...
Refactor search and doc controllers to allow for post-processing middleware
to handle geojson and response sending. Allows for a much more flexible routing scheme.
9 years ago
Julian Simioni
b547111d52
Remove latitude restrictions
9 years ago
Julian Simioni
396f27dcba
Mark previously invalid lat/lon test values as valid
...
These examples should all now pass with the lat/lon wrapping.
9 years ago
Severyn Kozak
9b77b4434f
Add more test-cases for invalid bbox values.
...
test/unit/sanitiser/search.js
-Add some more sanity-check test-cases to verify that bbox
validation is working as expected.
9 years ago
Severyn Kozak
762ef85f5c
Fix longitude-sanitization tests.
...
test/unit/sanitiser/(search, suggest, reverse).js
-Update/fix all of the tests that started failing as a result of
the removal of longitude sanitization in 90a7683
.
9 years ago
Julian Simioni
167547a6c1
Rename doc endpoint to place
9 years ago
Julian Simioni
2fce64f75a
Move files
9 years ago
Julian Simioni
4e74e9b681
Whitespace
9 years ago
Harish Krishna
35105015b2
tests suggest sanitiser
9 years ago
Harish Krishna
e00c5aa2ad
Testing search sanitisers
...
all sanitiser tests should test sanitizing input, lat/lon etc..
query parsing is tested seperately so, using query_parser to set expected.parsed_input
9 years ago
Harish Krishna
95c0e7461d
TESTS!
9 years ago
Harish Krishna
96a21570be
fixing layers related bug - adding a default_layers_set flag to clean obj.
9 years ago
Harish Krishna
050c11ec0b
just using a forked version of addressIt that focuses on US addresses (for now), modifying search queries and ignoring tests for now
10 years ago
Diana Shkolnikov
63ed198320
Details param not working as expected
...
Fixes #135
10 years ago
Diana Shkolnikov
0b44ba68c3
forgot to add test to commit
10 years ago
Diana Shkolnikov
6ae1a4f7df
fix comments and tests
10 years ago
Diana Shkolnikov
8ac17d0cb2
Fix bbox parsing
10 years ago
Diana Shkolnikov
8c22f33dc7
Add details sanitizer to suggest/coarse
10 years ago
Diana Shkolnikov
45ba29cc54
Add categories param to /reverse
10 years ago
Harish Krishna
7667a898dd
param layers should be called layers consistently across the API
10 years ago
Harish Krishna
71499cd201
flipping default behavior - by default its details=true
10 years ago
Harish Krishna
af45b4743c
oh so many more tests!
10 years ago
Harish Krishna
c99c5f712a
adding a parameter called details (defaults to false for all endpoint except reverse) + fixing tests
10 years ago
Harish Krishna
9502ab8854
fixing failing tests
10 years ago
Harish Krishna
5094ecb25e
adding 'locality', 'local_admin' to the list of layers (part of admin alias) plus tests
10 years ago
Harish Krishna
5b34767e8e
tests for sanitizer/search (tests optional geo basically in addition to the usual stuff - suggest/search sanitizer tests should eventually be merged)
10 years ago
Harish Krishna
ec2507f155
tests: reverse sanitizers (latlon is required, size defaults to 1, supports layers)
10 years ago
Harish Krishna
5f30559680
testing inputs with comma
10 years ago
Harish Krishna
827a93be11
Revert "adding geoname to coarse [experimental]"
...
This reverts commit 2424b0c9e2
.
10 years ago
Harish Krishna
2424b0c9e2
adding geoname to coarse [experimental]
10 years ago
Harish Krishna
650e88d79f
making geo bias optional - first pass with all tests passing
10 years ago
Harish Krishna
a67f640acb
adding address type to layers by default
10 years ago
Harish Krishna
68aabd7647
tests
10 years ago
Peter Johnson
9d10f0fa49
add osm address type
10 years ago
Peter Johnson
293465b90c
add address alias and openaddresses type. change default layers to 'poi,admin'. add comments. update tests
10 years ago
Harish Krishna
3973039f19
min/max lat/lon to form bbox from the input params
10 years ago
Harish Krishna
8a7b41edc6
test bbox sanitization
10 years ago
Harish Krishna
69a13e9105
fixing all the js lint related issues (lintified)
10 years ago
Harish Krishna
81b3668b30
get to doc
10 years ago
Harish Krishna
5e42b4ac0c
de-dupe as part of sanitizing
10 years ago
Harish Krishna
b828a05b01
simplifying things, DRY - one endpoint 'GET' handles single/multiple requests. plus test coverage
10 years ago
Harish Krishna
0dd495a378
going from ?id=123&type=geoname to ?id=geoname/123
...
tests updated
10 years ago
Harish Krishna
ed5a1923d3
grouping test cases when appropriate
10 years ago
Harish Krishna
018ee3b945
tests - adding get sanitizer tests, renaming sanitiser to suggest because that is what it is really.
10 years ago
Harish Krishna
6b29c5bbfe
adding 'aliases' - 'poi' & 'admin' for the layers param.
10 years ago
Peter Johnson
03a60831b4
fix lat error
10 years ago
Harish Krishna
32275aca56
split sanitizers into reusable pieces. renaming sanitise to suggest. using suggest sanitizer for search. adding reverse sanitizer. updating tests..
10 years ago
Peter Johnson
ffda37adff
tests
10 years ago