From 0b8538a65bd5a665bf82e1bd2e6607ba8428da49 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 12 Jan 2021 11:18:04 +0100 Subject: [PATCH] Fix FeedController test Signed-off-by: Thomas Citharel --- test/web/controllers/feed_controller_test.exs | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/test/web/controllers/feed_controller_test.exs b/test/web/controllers/feed_controller_test.exs index 7d141b263..f6250cca2 100644 --- a/test/web/controllers/feed_controller_test.exs +++ b/test/web/controllers/feed_controller_test.exs @@ -95,8 +95,23 @@ defmodule Mobilizon.Web.FeedControllerTest do group = insert(:group, visibility: :public) tag1 = insert(:tag, title: "iCalendar", slug: "icalendar") tag2 = insert(:tag, title: "Apple", slug: "apple") - event1 = insert(:event, organizer_actor: actor, attributed_to: group, tags: [tag1]) - event2 = insert(:event, organizer_actor: actor, attributed_to: group, tags: [tag1, tag2]) + + event1 = + insert(:event, + organizer_actor: actor, + attributed_to: group, + tags: [tag1], + title: "Event One" + ) + + event2 = + insert(:event, + organizer_actor: actor, + attributed_to: group, + tags: [tag1, tag2], + title: "Event Two", + begins_on: DateTime.add(DateTime.utc_now(), 3_600 * 12 * 4) + ) conn = conn @@ -110,7 +125,7 @@ defmodule Mobilizon.Web.FeedControllerTest do assert res =~ "BEGIN:VCALENDAR" assert response_content_type(conn, :calendar) =~ "charset=utf-8" - [entry1, entry2] = entries = ExIcal.parse(res) + [entry2, entry1] = entries = ExIcal.parse(res) Enum.each(entries, fn entry -> assert entry.summary in [event1.title, event2.title]