Add more tests for user

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-11-28 14:48:55 +01:00
parent c9f58ea899
commit 0cb39de01e
2 changed files with 332 additions and 218 deletions

View File

@@ -27,7 +27,7 @@ defmodule MobilizonWeb.Resolvers.User do
with {:ok, %User{} = user} <- Actors.get_user_by_email(email, true),
{:ok, token, _} <- Actors.authenticate(%{user: user, password: password}),
%Actor{} = actor <- Actors.get_actor_for_user(user) do
{:ok, %{token: token, user: user, actor: actor}}
{:ok, %{token: token, user: user, person: actor}}
else
{:error, :user_not_found} ->
{:error, "User with email not found"}