feat(api): optional auth for public search and studio week. Refs EventHub/EventHubFront#58
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
%%% - поиск с фильтрацией по датам (from/to)
|
||||
%%% - геопоиск (lat, lon, radius)
|
||||
%%% - пагинацию результатов
|
||||
%%% - ошибку 401 без токена
|
||||
%%% - публичный поиск без токена (200)
|
||||
%%% @end
|
||||
%%%-------------------------------------------------------------------
|
||||
-module(user_search_tests).
|
||||
@@ -120,7 +120,9 @@ test_search_pagination(Token) ->
|
||||
ct:pal(" OK").
|
||||
|
||||
test_search_unauthorized() ->
|
||||
ct:pal(" TEST: Search without token"),
|
||||
ct:pal(" TEST: Search without token (public)"),
|
||||
Resp = api_test_runner:client_request(get, <<"/v1/search?q=test">>, <<>>),
|
||||
?assertMatch({ok, 401, _, _}, Resp),
|
||||
ct:pal(" OK: got 401").
|
||||
{ok, 200, _, Body} = Resp,
|
||||
Decoded = jsx:decode(list_to_binary(Body), [return_maps]),
|
||||
?assert(is_map(Decoded)),
|
||||
ct:pal(" OK: guest search 200").
|
||||
Reference in New Issue
Block a user