Closed seriema closed 9 years ago
Still trying to steal some time away to work on this. Hopefully be done this week.
No problem! I'd love to hear your comments on the questions above.
Had some time to look around more of the code and think about your questions.
So for the global feature we will add 2 config options, forceLowerCaseQueries, stripQueries.
Anything else?
Thanks!
If anyone wants to discuss this feature, I've opened a Gitter chatroom.
Currently query parameters in the API URL are just stripped out. There should be an optional setting for including them in the redirect.
Use case Better testing of search-like features where one could test search terms that will give different search results, such as no results, a few results, a lot of results, spelling suggestions, etc.
Usage Config set in the
config()
by settingstripQueries
tofalse
(default istrue
). Sample:Descoped (do this later as a separate feature): Local and global flag set on individual requests, which would be perfect for isolated testing of a autocompletion type search. To not pollute the
$http
config we should scope it withinapiMock
, but that requires another feature (to allow config objects instead of justtrue/false
). Sample:Effect
/api/pokemon?name=Pikachu
no longer strips the query and redirects to/mock_data/pokemon.get.json
. Instead it redirects to/mock_data/pokemon/name=pikachu.get.json
(similar to #13 where/api/pokemon
would redirect to/mock_data/pokemon/get.json
instead of/mock_data/pokemon.get.json
, but for now we only do this for URL's with queries).Pikaču
becomespika%C4%8Du
).strength=...&name=...
becomesname=...&strength=...
).