From 11b57f00f14c1f6129206629f0cfa391dc491a6c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 4 Aug 2020 09:24:09 +0200 Subject: [PATCH] Fix events test for new search signature Signed-off-by: Thomas Citharel --- test/mobilizon/events/events_test.exs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/mobilizon/events/events_test.exs b/test/mobilizon/events/events_test.exs index 71f748049..99c808c10 100644 --- a/test/mobilizon/events/events_test.exs +++ b/test/mobilizon/events/events_test.exs @@ -60,16 +60,18 @@ defmodule Mobilizon.EventsTest do test "build_events_for_search/1 returns events for a given name", %{ event: %Event{title: title} = event } do - assert title == hd(Events.build_events_for_search(event.title).elements).title + assert title == hd(Events.build_events_for_search(%{term: event.title}).elements).title %Event{} = event2 = insert(:event, title: "Special event") Workers.BuildSearch.insert_search_event(event2) assert event2.title == - Events.build_events_for_search("Special").elements |> hd() |> Map.get(:title) + Events.build_events_for_search(%{term: "Special"}).elements + |> hd() + |> Map.get(:title) assert event2.title == - Events.build_events_for_search(" Spécïal ").elements + Events.build_events_for_search(%{term: " Spécïal "}).elements |> hd() |> Map.get(:title) @@ -79,9 +81,9 @@ defmodule Mobilizon.EventsTest do Workers.BuildSearch.insert_search_event(event3) assert event3.title == - Events.build_events_for_search("hola").elements |> hd() |> Map.get(:title) + Events.build_events_for_search(%{term: "hola"}).elements |> hd() |> Map.get(:title) - assert %Page{elements: [], total: 0} == Events.build_events_for_search("") + assert %Page{elements: _elements, total: 3} = Events.build_events_for_search(%{term: ""}) end test "find_close_events/3 returns events in the area" do