From 5e6bdb92fbd6c6beb7045aa0973930a7ccfe27e7 Mon Sep 17 00:00:00 2001
From: Thomas Citharel <tcit@tcit.fr>
Date: Wed, 3 Jun 2020 15:33:50 +0200
Subject: [PATCH] Fix tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
---
 lib/web/templates/email/email.html.eex      |  2 +-
 lib/web/templates/email/email.text.eex      |  2 +-
 test/graphql/resolvers/participant_test.exs | 14 +++++---------
 test/support/abinthe_helpers.ex             |  1 -
 4 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/lib/web/templates/email/email.html.eex b/lib/web/templates/email/email.html.eex
index 266397326..eef14eb44 100644
--- a/lib/web/templates/email/email.html.eex
+++ b/lib/web/templates/email/email.html.eex
@@ -71,7 +71,7 @@
             <![endif]-->
         </td>
     </tr>
-    <%= render @view_module, @view_template, assigns %>
+    <%= @inner_content %>
     <% if Mobilizon.Config.instance_demo_mode?() do %>
     <!-- BETA WARNING -->
         <tr>
diff --git a/lib/web/templates/email/email.text.eex b/lib/web/templates/email/email.text.eex
index b3da75856..218af8062 100644
--- a/lib/web/templates/email/email.text.eex
+++ b/lib/web/templates/email/email.text.eex
@@ -1,4 +1,4 @@
-<%= render @view_module, @view_template, assigns %>
+<%= @inner_content %>
 
 
 --
diff --git a/test/graphql/resolvers/participant_test.exs b/test/graphql/resolvers/participant_test.exs
index c7a70be3e..44a4159bb 100644
--- a/test/graphql/resolvers/participant_test.exs
+++ b/test/graphql/resolvers/participant_test.exs
@@ -508,7 +508,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
             actorId: actor.id,
             roles: "participant,moderator,administrator,creator",
             page: 1,
-            limit: 1
+            limit: 2
           }
         )
 
@@ -516,11 +516,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
 
       sorted_participants =
         res["data"]["event"]["participants"]["elements"]
-        |> Enum.sort_by(
-          &(&1
-            |> Map.get("actor")
-            |> Map.get("preferredUsername"))
-        )
+        |> Enum.filter(&(&1["role"] == "CREATOR"))
 
       assert sorted_participants == [
                %{
@@ -540,8 +536,8 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
             uuid: event.uuid,
             actorId: actor.id,
             roles: "participant,moderator,administrator,creator",
-            page: 2,
-            limit: 1
+            page: 1,
+            limit: 2
           }
         )
 
@@ -1321,7 +1317,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
                |> hd
 
       update_participation_mutation = """
-          mutation UpdateParticipation($participantId: ID!, $role: String!, $moderatorActorId: ID!) {
+          mutation UpdateParticipation($participantId: ID!, $role: ParticipantRoleEnum!, $moderatorActorId: ID!) {
             updateParticipation(id: $participantId, role: $role, moderatorActorId: $moderatorActorId) {
                 id,
                 role,
diff --git a/test/support/abinthe_helpers.ex b/test/support/abinthe_helpers.ex
index cc8037d85..4070dd808 100644
--- a/test/support/abinthe_helpers.ex
+++ b/test/support/abinthe_helpers.ex
@@ -3,7 +3,6 @@ defmodule Mobilizon.GraphQL.AbsintheHelpers do
   Absinthe helpers for tests
   """
 
-  import Plug.Conn
   import Phoenix.ConnTest
 
   alias Plug.Conn