Make tests great again !

(Also use only one field for public/private key pem)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-06-14 17:25:55 +02:00
parent 32596c3624
commit ca36dd12e2
43 changed files with 498 additions and 656 deletions

View File

@@ -16,9 +16,9 @@ defmodule EventosWeb.TrackControllerTest do
end
setup %{conn: conn} do
account = insert(:account)
user = insert(:user, account: account)
event = insert(:event, organizer_account: account)
actor = insert(:actor)
user = insert(:user, actor: actor)
event = insert(:event, organizer_actor: actor)
{:ok, conn: conn, user: user, event: event}
end
@@ -94,11 +94,4 @@ defmodule EventosWeb.TrackControllerTest do
track = insert(:track)
{:ok, track: track}
end
defp auth_conn(conn, %Eventos.Accounts.User{} = user) do
{:ok, token, _claims} = EventosWeb.Guardian.encode_and_sign(user)
conn
|> put_req_header("authorization", "Bearer #{token}")
|> put_req_header("accept", "application/json")
end
end