fix module aliasing issues
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user