mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-23 21:54:33 +01:00
Updates tests to handle email finding in CI.
This commit is contained in:
parent
1afd0bbd88
commit
994979d5f1
2 changed files with 3 additions and 2 deletions
|
@ -20,7 +20,7 @@ defmodule PhilomenaWeb.DeactivationControllerTest do
|
||||||
assert redirected_to(conn) == ~p"/"
|
assert redirected_to(conn) == ~p"/"
|
||||||
conn = get(conn, ~p"/registrations/edit")
|
conn = get(conn, ~p"/registrations/edit")
|
||||||
assert redirected_to(conn) == ~p"/sessions/new"
|
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)
|
user = Users.get_user!(user.id)
|
||||||
assert user.deleted_by_user_id == user.id
|
assert user.deleted_by_user_id == user.id
|
||||||
|
|
|
@ -18,7 +18,8 @@ defmodule PhilomenaWeb.ReactivationControllerTest do
|
||||||
describe "POST /reactivations/:id" do
|
describe "POST /reactivations/:id" do
|
||||||
test "reactivate account page works", %{conn: conn, user: user} do
|
test "reactivate account page works", %{conn: conn, user: user} do
|
||||||
conn = delete(conn, ~p"/deactivations")
|
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)
|
conn = post(conn, reactivation_link)
|
||||||
assert redirected_to(conn) == ~p"/"
|
assert redirected_to(conn) == ~p"/"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue