Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Fix email deliver not being handled
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Ceolin committed Nov 21, 2023
1 parent 052641d commit 0950fb6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/accounts/user_live/registration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ defmodule UneebeeWeb.Live.Registration do
def handle_event("save", %{"user" => user_params}, socket) do
case Accounts.register_user(user_params) do
{:ok, user} ->
{:ok, _} =
confirm_account(user, socket.assigns.host_school)
confirm_account(user, socket.assigns.host_school)

maybe_create_school_user(user, socket.assigns.school)

Expand Down
21 changes: 21 additions & 0 deletions test/accounts/user_live/user_registration_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@ defmodule UneebeeWeb.UserRegistrationLiveTest do
end
end

describe "register user (without email confirmation)" do
setup do
set_school(%{conn: build_conn()}, %{require_confirmation?: false})
end

test "creates account and logs the user in", %{conn: conn} do
{:ok, lv, _html} = live(conn, ~p"/users/register")

attrs = valid_user_attributes()
form = form(lv, "#registration_form", user: attrs)
render_submit(form)
conn = follow_trigger_action(form, conn)

assert redirected_to(conn) == ~p"/"

# Now do a logged in request
response = html_response(get(conn, ~p"/courses"), 200)
assert response =~ "Settings"
end
end

describe "register user (school configured)" do
setup do
set_school(%{conn: build_conn()}, %{require_confirmation?: true})
Expand Down

0 comments on commit 0950fb6

Please sign in to comment.