feat: GET /v1/user/booking-requests + search image_url. Fixes EventHub/EventHubBack#59
This commit is contained in:
@@ -25,6 +25,7 @@ logic_search_test_() ->
|
||||
{"Search events by location", fun test_search_events_by_location/0},
|
||||
{"Combined search", fun test_combined_search/0},
|
||||
{"Search calendars", fun test_search_calendars/0},
|
||||
{"Search calendars include image_url", fun test_search_calendars_image_url/0},
|
||||
{"Search all", fun test_search_all/0},
|
||||
{"Pagination", fun test_pagination/0},
|
||||
{"Sorting", fun test_sorting/0},
|
||||
@@ -175,6 +176,14 @@ test_search_calendars() ->
|
||||
{Total2, _} = calendars_from(logic_search:search(<<"calendar">>, <<"Calendar">>, OwnerId, #{})),
|
||||
?assertEqual(2, Total2).
|
||||
|
||||
test_search_calendars_image_url() ->
|
||||
OwnerId = create_test_user(user),
|
||||
CalendarId = create_test_calendar(OwnerId, commercial, [<<"cover">>]),
|
||||
{ok, _} = core_calendar:update(CalendarId, [{image_url, <<"https://cdn.example/cal.jpg">>}]),
|
||||
{_, Cals} = calendars_from(logic_search:search(<<"calendar">>, <<"Calendar">>, OwnerId, #{})),
|
||||
[Hit | _] = [C || C <- Cals, maps:get(id, C) =:= CalendarId],
|
||||
?assertEqual(<<"https://cdn.example/cal.jpg">>, maps:get(image_url, Hit)).
|
||||
|
||||
test_search_all() ->
|
||||
OwnerId = create_test_user(user),
|
||||
CalendarId = create_test_calendar(OwnerId, personal, []),
|
||||
|
||||
Reference in New Issue
Block a user