fix module aliasing issues

This commit is contained in:
2026-05-05 23:04:01 +01:00
parent 0a7ad6af8a
commit 11396e37a8
11 changed files with 43 additions and 22 deletions
@@ -59,7 +59,9 @@ defmodule FirehoseWeb.UserRegistrationControllerTest do
Application.put_env(:firehose, :allowed_registration_email, "allowed@example.com")
on_exit(fn -> Application.delete_env(:firehose, :allowed_registration_email) end)
response = conn |> post(~p"/users/register", %{"user" => %{"email" => "allowed@example.com"}})
response =
conn |> post(~p"/users/register", %{"user" => %{"email" => "allowed@example.com"}})
assert Phoenix.Flash.get(response.assigns.flash, :info) =~ "email was sent"
end
@@ -67,13 +69,17 @@ defmodule FirehoseWeb.UserRegistrationControllerTest do
Application.put_env(:firehose, :allowed_registration_email, "allowed@example.com")
on_exit(fn -> Application.delete_env(:firehose, :allowed_registration_email) end)
assert conn |> post(~p"/users/register", %{"user" => %{"email" => "other@example.com"}}) |> html_response(200) =~ "registration is invite only"
assert conn
|> post(~p"/users/register", %{"user" => %{"email" => "other@example.com"}})
|> html_response(200) =~ "registration is invite only"
end
test "fails with invite-only message when env var is unset", %{conn: conn} do
Application.delete_env(:firehose, :allowed_registration_email)
assert conn |> post(~p"/users/register", %{"user" => %{"email" => "anyone@example.com"}}) |> html_response(200) =~ "registration is invite only"
assert conn
|> post(~p"/users/register", %{"user" => %{"email" => "anyone@example.com"}})
|> html_response(200) =~ "registration is invite only"
end
end
end