Implement search engine & service in backend

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-22 10:25:28 +02:00
parent 59caac86a1
commit b5f9518faf
10 changed files with 226 additions and 45 deletions

View File

@@ -46,13 +46,13 @@ defmodule MobilizonWeb.API.SearchTest do
test "search events" do
with_mock Events,
build_events_by_name: fn "toto", 1, 10 ->
build_events_for_search: fn "toto", 1, 10 ->
%Page{total: 1, elements: [%Event{title: "super toto event"}]}
end do
assert {:ok, %{total: 1, elements: [%Event{title: "super toto event"}]}} =
Search.search_events("toto", 1, 10)
assert_called(Events.build_events_by_name("toto", 1, 10))
assert_called(Events.build_events_for_search("toto", 1, 10))
end
end
end