Fix API test

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-08-05 12:08:52 +02:00
parent fcf5778ae5
commit 59a4a41043

View File

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