Updates tests to handle email finding in CI.

This commit is contained in:
May Tusek 2025-02-14 15:01:46 -08:00
parent 1afd0bbd88
commit 994979d5f1
2 changed files with 3 additions and 2 deletions

View file

@ -20,7 +20,7 @@ defmodule PhilomenaWeb.DeactivationControllerTest do
assert redirected_to(conn) == ~p"/"
conn = get(conn, ~p"/registrations/edit")
assert redirected_to(conn) == ~p"/sessions/new"
assert Memory.all() |> Enum.count() == 1
assert Memory.all() |> Enum.find(&(&1.subject == "Reactivation instructions for your account")) != nil
user = Users.get_user!(user.id)
assert user.deleted_by_user_id == user.id

View file

@ -18,7 +18,8 @@ defmodule PhilomenaWeb.ReactivationControllerTest do
describe "POST /reactivations/:id" do
test "reactivate account page works", %{conn: conn, user: user} do
conn = delete(conn, ~p"/deactivations")
reactivation_link = Memory.all() |> hd |> extract_reactivation_link_from_email
reactivation_link = Memory.all() |> Enum.find(&(&1.subject == "Reactivation instructions for your account")) |> extract_reactivation_link_from_email()
assert reactivation_link != nil
conn = post(conn, reactivation_link)
assert redirected_to(conn) == ~p"/"