diff --git a/.gitignore b/.gitignore index b6e05d3..f4572ae 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ gallium-*.tar npm-debug.log /assets/node_modules/ .env.dev +.env diff --git a/lib/gallium/ticketing.ex b/lib/gallium/ticketing.ex index 074d817..c47e750 100644 --- a/lib/gallium/ticketing.ex +++ b/lib/gallium/ticketing.ex @@ -306,6 +306,17 @@ defmodule Gallium.Ticketing do Repo.get_by(Attendee, user_id: user_id) end + def get_purchase_by_user_id(user_id) do + attendee = + Attendee + |> Repo.get_by(user_id: user_id) + |> Repo.preload([:accompany, :payment]) + + ticket = Repo.get_by(Ticket, user_id: user_id) + + %{attendee: attendee, ticket: ticket} + end + def create_booking(form_data, has_accompany?, user_id) do data = form_data diff --git a/lib/gallium/ticketing/checkout_form.ex b/lib/gallium/ticketing/checkout_form.ex index acac0a9..2e0668e 100644 --- a/lib/gallium/ticketing/checkout_form.ex +++ b/lib/gallium/ticketing/checkout_form.ex @@ -45,6 +45,10 @@ defmodule Gallium.Ticketing.CheckoutForm do ) |> validate_cesium_member(:student_number, :is_cesium_member) |> validate_format(:nif, ~r/^\d{9}$/, message: "O NIF tem de ter exatamente 9 números") + |> validate_length(:table_preference, + max: 30, + message: "A preferência da mesa tem de ter no máximo 30 caracteres" + ) |> cast_embed(:accompany, with: &accompany_changeset/2) end diff --git a/lib/gallium_web/components/forecast.ex b/lib/gallium_web/components/forecast.ex index 4aeed90..faca51a 100644 --- a/lib/gallium_web/components/forecast.ex +++ b/lib/gallium_web/components/forecast.ex @@ -25,8 +25,8 @@ defmodule GalliumWeb.Components.Forecast do /> <.card icon="hero-musical-note" - title="Karaoke & Animação" - description="Diverte-te com karaoke, cantores quebra-gelo e muitas outras surpresas ao longo da noite." + title="Animação" + description="Diverte-te com cartões quebra-gelo e muitas outras surpresas ao longo da noite." /> <.card icon="hero-camera" diff --git a/lib/gallium_web/components/info_component.ex b/lib/gallium_web/components/info_component.ex index 4930d8a..8479e4f 100644 --- a/lib/gallium_web/components/info_component.ex +++ b/lib/gallium_web/components/info_component.ex @@ -24,15 +24,7 @@ defmodule GalliumWeb.Components.InfoSection do

Viagem de Ida

Paragem da UM • Quinta

-

18H30 • 19H

- - -
-
- <.icon name="hero-clock" class="h-5 w-5" /> -

Sessão Fotográfica

-
-

19H30 • 20H

+

18H • 19:00H

@@ -40,7 +32,7 @@ defmodule GalliumWeb.Components.InfoSection do <.icon name="hero-truck" class="h-5 w-5" />

Regresso

-

3H

+

2H

diff --git a/lib/gallium_web/components/program_section.ex b/lib/gallium_web/components/program_section.ex index eb8164f..227862a 100644 --- a/lib/gallium_web/components/program_section.ex +++ b/lib/gallium_web/components/program_section.ex @@ -9,13 +9,13 @@ defmodule GalliumWeb.Components.ProgramSection do attr :schedule_items, :list, default: [ %{ - time: "18H30", + time: "18H", title: "PARTIDA DA UNIVERSIDADE", description: "Encontro na paragem da UM para embarque no autocarro" }, %{ - time: "19H30", - title: "CHEGADA À QUINTA DA ALDEIA", + time: "19H", + title: "CHEGADA À QUINTA VINHA DO CABO", description: "Recepção com entradas e bebidas de boas-vindas" }, %{ @@ -26,15 +26,15 @@ defmodule GalliumWeb.Components.ProgramSection do %{ time: "20H30", title: "JANTAR", - description: "Sopa, prato principal e sobremesa servidos à mesa" + description: "Sopa, prato principal e sobremesa" }, %{ time: "22H00", - title: "ANIMAÇÃO & KARAOKE", - description: "Música, karaoke, cartões quebra-gelo e muitas surpresas" + title: "ANIMAÇÃO", + description: "Música, cartões quebra-gelo e muitas surpresas" }, %{ - time: "3H", + time: "2H", title: "REGRESSO À UNIVERSIDADE", description: "Autocarro de volta ao ponto de partida" } @@ -67,7 +67,7 @@ defmodule GalliumWeb.Components.ProgramSection do

- Não percas atividades incríveis como karaoke, cartões quebra-gelo e muitas outras surpresas! + Não percas atividades incríveis como cartões quebra-gelo e muitas outras surpresas!

diff --git a/lib/gallium_web/components/ticket_section.ex b/lib/gallium_web/components/ticket_section.ex index 5d16970..63630e8 100644 --- a/lib/gallium_web/components/ticket_section.ex +++ b/lib/gallium_web/components/ticket_section.ex @@ -35,7 +35,7 @@ defmodule GalliumWeb.Components.TicketSection do "Jantar completo", "Sessão fotográfica", "Transporte opcional", - "Animação e karaoke" + "Animação" ]} /> @@ -47,7 +47,7 @@ defmodule GalliumWeb.Components.TicketSection do "Jantar completo", "Sessão fotográfica", "Transporte opcional", - "Animação e karaoke" + "Animação" ]} /> diff --git a/lib/gallium_web/controllers/midas_controller.ex b/lib/gallium_web/controllers/midas_controller.ex index 314dfc3..9002698 100644 --- a/lib/gallium_web/controllers/midas_controller.ex +++ b/lib/gallium_web/controllers/midas_controller.ex @@ -4,7 +4,7 @@ defmodule GalliumWeb.MidasController do alias Gallium.Ticketing def handle_webhook(conn, %{"api_key" => api_key, "order_id" => order_id}) do - if api_key == Application.fetch_env!(:gallium, :midas)[:midas_api_key] do + if api_key == Application.fetch_env!(:gallium, :midas)[:api_key] do process_payment_if_pending(conn, order_id) else send_resp(conn, 403, "invalid api key") @@ -12,7 +12,7 @@ defmodule GalliumWeb.MidasController do end def payment_received(conn, %{"orderId" => order_id, "key" => api_key}) do - if api_key == Application.fetch_env!(:gallium, :midas)[:midas_api_key] do + if api_key == Application.fetch_env!(:gallium, :midas)[:api_key] do process_payment_if_pending(conn, order_id) else send_resp(conn, 403, "invalid api key") diff --git a/lib/gallium_web/live/landing/index.html.heex b/lib/gallium_web/live/landing/index.html.heex index db29d10..566f1b5 100644 --- a/lib/gallium_web/live/landing/index.html.heex +++ b/lib/gallium_web/live/landing/index.html.heex @@ -1,6 +1,6 @@
<.hero - date_info="05/06 • Quinta da Aldeia" + date_info="05/06 • Quinta Vinha do Cabo" ticket_url="/tickets/buy" /> diff --git a/lib/gallium_web/live/ticketing_purchase/index.ex b/lib/gallium_web/live/ticketing_purchase/index.ex index 82b7c1b..fafb775 100644 --- a/lib/gallium_web/live/ticketing_purchase/index.ex +++ b/lib/gallium_web/live/ticketing_purchase/index.ex @@ -3,7 +3,6 @@ defmodule GalliumWeb.TicketingPurchaseLive.Index do use GalliumWeb, :app_view import GalliumWeb.Components.{Button, Stepper} - alias Gallium.Accounts alias Gallium.Ticketing alias Gallium.Ticketing.{CheckoutForm, TicketType} @@ -13,37 +12,22 @@ defmodule GalliumWeb.TicketingPurchaseLive.Index do def mount(params, _session, socket) do # takes the type of the ticket from the url is_cesium_member? = Map.get(params, "type", "nao_socio") == "socio" + user_id = socket.assigns.current_scope.user.id + purchase = Ticketing.get_purchase_by_user_id(user_id) - user_info = - case Accounts.get_user_info_by_id(socket.assigns.current_scope.user.id) do - {:ok, %{payment: %{status: status}} = attendee} when status in [:paid, :pending] -> - attendee + socket = + case purchase_state(purchase) do + {:blocked, attendee} -> + assign_blocked_purchase(socket, attendee, is_cesium_member?) - _ -> - nil - end + {:resume, attendee} -> + assign_resumable_purchase(socket, attendee) - initial_changeset = - CheckoutForm.changeset_personal_data( - %CheckoutForm{is_cesium_member: is_cesium_member?}, - %{} - ) - - price_per_ticket = - if is_cesium_member?, - do: TicketType.price_for_member(), - else: TicketType.price_for_non_member() + :new -> + assign_new_purchase(socket, is_cesium_member?) + end - {:ok, - socket - |> assign(:current_step, 1) - |> assign(:form_data, to_form(initial_changeset)) - |> assign(:has_accompany?, false) - |> assign(:amount_to_pay, nil) - |> assign(:price_per_ticket, price_per_ticket) - |> assign(:companion_price, price_per_ticket) - |> assign(:payment_status, :pending) - |> assign(:user_info, user_info)} + {:ok, socket} end @impl true @@ -51,6 +35,11 @@ defmodule GalliumWeb.TicketingPurchaseLive.Index do {:noreply, update(socket, :current_step, &(&1 + 1))} end + @impl true + def handle_event("previous_step", _params, %{assigns: %{resuming_purchase?: true}} = socket) do + {:noreply, socket} + end + @impl true def handle_event("previous_step", _params, socket) do {:noreply, update(socket, :current_step, &max(&1 - 1, 1))} @@ -208,4 +197,114 @@ defmodule GalliumWeb.TicketingPurchaseLive.Index do def handle_info({:payment_order_updated, payment}, socket) do {:noreply, assign(socket, :payment_status, payment.status)} end + + defp purchase_state(%{attendee: %{payment: %{status: :paid}} = attendee}) do + {:blocked, attendee} + end + + defp purchase_state(%{attendee: attendee}) when not is_nil(attendee) do + {:resume, attendee} + end + + defp purchase_state(_purchase), do: :new + + defp assign_new_purchase(socket, is_cesium_member?) do + initial_changeset = + CheckoutForm.changeset_personal_data( + %CheckoutForm{is_cesium_member: is_cesium_member?}, + %{} + ) + + price_per_ticket = price_per_ticket(is_cesium_member?) + + socket + |> assign(:current_step, 1) + |> assign(:form_data, to_form(initial_changeset)) + |> assign(:has_accompany?, false) + |> assign(:amount_to_pay, nil) + |> assign(:price_per_ticket, price_per_ticket) + |> assign(:companion_price, price_per_ticket) + |> assign(:payment_status, :pending) + |> assign(:purchase_blocked?, false) + |> assign(:resuming_purchase?, false) + |> assign(:user_info, nil) + end + + defp assign_resumable_purchase(socket, attendee) do + if connected?(socket) && attendee.payment && attendee.payment.status == :pending do + Ticketing.subscribe_to_payment_order_updates(attendee.payment.order_id) + end + + has_accompany? = not is_nil(attendee.accompany) + price_per_ticket = price_per_ticket(attendee.is_cesium_member) + amount_to_pay = existing_amount_to_pay(attendee, price_per_ticket, has_accompany?) + checkout_form = checkout_form_from_attendee(attendee) + payment_changeset = CheckoutForm.changeset_payment(checkout_form, %{}) + + socket + |> assign(:current_step, 3) + |> assign(:form_data, to_form(payment_changeset)) + |> assign(:has_accompany?, has_accompany?) + |> assign(:amount_to_pay, amount_to_pay) + |> assign(:price_per_ticket, price_per_ticket) + |> assign(:companion_price, price_per_ticket) + |> assign(:payment_status, payment_status(attendee)) + |> assign(:purchase_blocked?, false) + |> assign(:resuming_purchase?, true) + |> assign(:user_info, attendee) + end + + defp assign_blocked_purchase(socket, attendee, is_cesium_member?) do + price_per_ticket = price_per_ticket(is_cesium_member?) + + socket + |> assign(:current_step, 1) + |> assign(:form_data, to_form(CheckoutForm.changeset_personal_data(%CheckoutForm{}, %{}))) + |> assign(:has_accompany?, false) + |> assign(:amount_to_pay, attendee.payment.amount) + |> assign(:price_per_ticket, price_per_ticket) + |> assign(:companion_price, price_per_ticket) + |> assign(:payment_status, :paid) + |> assign(:purchase_blocked?, true) + |> assign(:resuming_purchase?, false) + |> assign(:user_info, attendee) + end + + defp checkout_form_from_attendee(attendee) do + %CheckoutForm{ + full_name: attendee.full_name, + student_number: attendee.student_number, + phone_number: attendee.phone_number, + nif: attendee.nif, + is_cesium_member: attendee.is_cesium_member, + wants_transport: attendee.wants_transport, + table_preference: attendee.table_preference, + allergies: attendee.allergies, + accompany: accompany_form_from_attendee(attendee.accompany) + } + end + + defp accompany_form_from_attendee(nil), do: nil + + defp accompany_form_from_attendee(accompany) do + %CheckoutForm.AccompanyForm{ + full_name: accompany.full_name, + email: accompany.email, + phone_number: accompany.phone_number + } + end + + defp existing_amount_to_pay(%{payment: %{amount: amount}}, _price_per_ticket, _has_accompany?) + when not is_nil(amount) do + amount + end + + defp existing_amount_to_pay(_attendee, price_per_ticket, true), do: price_per_ticket * 2 + defp existing_amount_to_pay(_attendee, price_per_ticket, false), do: price_per_ticket + + defp payment_status(%{payment: %{status: status}}), do: status + defp payment_status(_attendee), do: :pending + + defp price_per_ticket(true), do: TicketType.price_for_member() + defp price_per_ticket(false), do: TicketType.price_for_non_member() end diff --git a/lib/gallium_web/live/ticketing_purchase/index.html.heex b/lib/gallium_web/live/ticketing_purchase/index.html.heex index 1556747..eab1ab7 100644 --- a/lib/gallium_web/live/ticketing_purchase/index.html.heex +++ b/lib/gallium_web/live/ticketing_purchase/index.html.heex @@ -1,5 +1,5 @@
- <%= if !@user_info do %> + <%= if !@purchase_blocked? do %>
<%= if @current_step < 4 do %> <.stepper @@ -24,6 +24,7 @@ has_accompany?={@has_accompany?} amount_to_pay={@amount_to_pay} price_per_ticket={@price_per_ticket} + resuming_purchase?={@resuming_purchase?} /> <% 4 -> %> <.confirmation diff --git a/lib/gallium_web/live/ticketing_purchase/steps/confirmation.html.heex b/lib/gallium_web/live/ticketing_purchase/steps/confirmation.html.heex index db62802..bb95f03 100644 --- a/lib/gallium_web/live/ticketing_purchase/steps/confirmation.html.heex +++ b/lib/gallium_web/live/ticketing_purchase/steps/confirmation.html.heex @@ -23,7 +23,7 @@

{if @payment_status == :paid, - do: "O teu pagamento foi recebido. Até já na Quinta da Aldeia!", + do: "O teu pagamento foi recebido. Até já na Quinta Vinha do Cabo!", else: "A tua reserva foi registada. Efetua o pagamento via MBWay para confirmares o teu bilhete."}

@@ -63,7 +63,7 @@ 5 de Junho, 2026
- Quinta da Aldeia, Guimarães + Quinta Vinha do Cabo, Guimarães
diff --git a/lib/gallium_web/live/ticketing_purchase/steps/payment.html.heex b/lib/gallium_web/live/ticketing_purchase/steps/payment.html.heex index f53e8c3..193bc18 100644 --- a/lib/gallium_web/live/ticketing_purchase/steps/payment.html.heex +++ b/lib/gallium_web/live/ticketing_purchase/steps/payment.html.heex @@ -47,17 +47,21 @@
-
- <.primary_button - type="button" - phx-click="previous_step" - text="Voltar" - color={:light_muted} - icon="hero-arrow-left" - iconpos={:left} - class="font-amarante" - /> -
+ <%= if !@resuming_purchase? do %> +
+ <.primary_button + type="button" + phx-click="previous_step" + text="Voltar" + color={:light_muted} + icon="hero-arrow-left" + iconpos={:left} + class="font-amarante" + /> +
+ <% else %> +
+ <% end %>
<.primary_button type="submit" diff --git a/lib/gallium_web/live/ticketing_purchase/steps/personal_data.html.heex b/lib/gallium_web/live/ticketing_purchase/steps/personal_data.html.heex index 66bfcb2..c8ee82c 100644 --- a/lib/gallium_web/live/ticketing_purchase/steps/personal_data.html.heex +++ b/lib/gallium_web/live/ticketing_purchase/steps/personal_data.html.heex @@ -153,14 +153,19 @@ <.input field={@form_data[:table_preference]} type="text" - label="Preferência de mesa (opcional)" - placeholder="ex: com o grupo X, junto à janela..." + label="Se queres reservar mesa com os teus amigos, indica aqui o nome" + placeholder="Nome da mesa (opcional)" + maxlength="30" > <:icon> <.icon name="hero-table-cells" class="size-5" /> +

+ Limite máximo de 10 pessoas por mesa. +

+ <.input field={@form_data[:allergies]} type="text" diff --git a/lib/gallium_web/live/tickets/index.html.heex b/lib/gallium_web/live/tickets/index.html.heex index 1b3b4d1..a102ca3 100644 --- a/lib/gallium_web/live/tickets/index.html.heex +++ b/lib/gallium_web/live/tickets/index.html.heex @@ -21,7 +21,7 @@ "Jantar completo", "Sessão fotográfica", "Transporte opcional", - "Animação e karaoke" + "Animação" ]} /> @@ -34,7 +34,7 @@ "Jantar completo", "Sessão fotográfica", "Transporte opcional", - "Animação e karaoke" + "Animação" ]} />
diff --git a/lib/gallium_web/live/user_live/confirmation.ex b/lib/gallium_web/live/user_live/confirmation.ex index c449f0b..ea0f119 100644 --- a/lib/gallium_web/live/user_live/confirmation.ex +++ b/lib/gallium_web/live/user_live/confirmation.ex @@ -32,7 +32,7 @@ defmodule GalliumWeb.UserLive.Confirmation do name={@form[:remember_me].name} value="true" phx-disable-with="A confirmar..." - text="Confirmar e ficar logado" + text="Confirmar e manter sessão iniciada neste dispositivo" class="font-cormorant text-lg py-3" color={:blue} /> @@ -68,7 +68,7 @@ defmodule GalliumWeb.UserLive.Confirmation do name={@form[:remember_me].name} value="true" phx-disable-with="A entrar..." - text="Mantém-me logado neste dispositivo" + text="Manter sessão iniciada neste dispositivo" class="font-cormorant text-lg py-3" color={:blue} /> diff --git a/lib/gallium_web/live/user_live/login.ex b/lib/gallium_web/live/user_live/login.ex index 3e85e86..d1ea030 100644 --- a/lib/gallium_web/live/user_live/login.ex +++ b/lib/gallium_web/live/user_live/login.ex @@ -91,7 +91,7 @@ defmodule GalliumWeb.UserLive.Login do <.primary_button class="font-cormorant" color={:blue} - text="Mantém-me logado neste dispositivo" + text="Manter sessão iniciada neste dispositivo" name={@form[:remember_me].name} value="true" icon="hero-arrow-right" diff --git a/lib/gallium_web/live/user_live/profile.ex b/lib/gallium_web/live/user_live/profile.ex index 9b6a1f3..c59245f 100644 --- a/lib/gallium_web/live/user_live/profile.ex +++ b/lib/gallium_web/live/user_live/profile.ex @@ -162,7 +162,7 @@ defmodule GalliumWeb.UserLive.Profile do

Ainda não tens bilhete

- Garante já o teu lugar no Jantar de Gala na Quinta da Aldeia. + Garante já o teu lugar no Jantar de Gala na Quinta Vinha do Cabo.

<.primary_button text="Comprar Bilhete" diff --git a/lib/gallium_web/live/user_live/registration.ex b/lib/gallium_web/live/user_live/registration.ex index fa8653e..6aea554 100644 --- a/lib/gallium_web/live/user_live/registration.ex +++ b/lib/gallium_web/live/user_live/registration.ex @@ -74,7 +74,7 @@ defmodule GalliumWeb.UserLive.Registration do socket |> put_flash( :info, - "Foi enviado um email para #{user.email}, acede a ele para confirmar a tua conta." + "Foi enviado um email para #{user.email}, acede para confirmar a tua conta." ) |> push_navigate(to: ~p"/users/log-in")} diff --git a/lib/gallium_web/user_auth.ex b/lib/gallium_web/user_auth.ex index c6c0073..601fefc 100644 --- a/lib/gallium_web/user_auth.ex +++ b/lib/gallium_web/user_auth.ex @@ -221,7 +221,10 @@ defmodule GalliumWeb.UserAuth do else socket = socket - |> Phoenix.LiveView.put_flash(:error, "Precisa de estar logado para acessar esta página.") + |> Phoenix.LiveView.put_flash( + :error, + "Precisas de ter a sessão iniciada para aceder a esta página." + ) |> Phoenix.LiveView.redirect(to: ~p"/users/log-in") {:halt, socket} @@ -247,7 +250,7 @@ defmodule GalliumWeb.UserAuth do else socket = socket - |> Phoenix.LiveView.put_flash(:error, "Precisa de ser admin para acessar esta página .") + |> Phoenix.LiveView.put_flash(:error, "Precisa de ser admin para aceder a esta página.") |> Phoenix.LiveView.redirect(to: ~p"/") {:halt, socket} @@ -281,7 +284,7 @@ defmodule GalliumWeb.UserAuth do conn else conn - |> put_flash(:error, "Precisa de estar logado para acessar esta página.") + |> put_flash(:error, "Precisa de ter sessão iniciada para aceder a esta página.") |> maybe_store_return_to() |> redirect(to: ~p"/users/log-in") |> halt() @@ -313,7 +316,7 @@ defmodule GalliumWeb.UserAuth do conn else conn - |> put_flash(:error, "Precisa de ser admin para acessar esta página.") + |> put_flash(:error, "Precisa de ser admin para aceder a esta página.") |> redirect(to: ~p"/") |> halt() end diff --git a/test/gallium_web/live/user_live/confirmation_test.exs b/test/gallium_web/live/user_live/confirmation_test.exs index ee5e782..77d8a07 100644 --- a/test/gallium_web/live/user_live/confirmation_test.exs +++ b/test/gallium_web/live/user_live/confirmation_test.exs @@ -19,7 +19,7 @@ defmodule GalliumWeb.UserLive.ConfirmationTest do {:ok, _lv, html} = live(conn, ~p"/users/log-in/#{token}") - assert html =~ "Confirmar e ficar logado" + assert html =~ "Confirmar e manter sessão iniciada" end test "renders login page for confirmed user", %{conn: conn, confirmed_user: user} do @@ -30,8 +30,8 @@ defmodule GalliumWeb.UserLive.ConfirmationTest do {:ok, _lv, html} = live(conn, ~p"/users/log-in/#{token}") - refute html =~ "Confirmar e ficar logado" - assert html =~ "Mantém-me logado neste dispositivo" + refute html =~ "Confirmar e manter sessão iniciada" + assert html =~ "Manter sessão iniciada neste dispositivo" end test "renders login page for already logged in user", %{conn: conn, confirmed_user: user} do diff --git a/test/gallium_web/live/user_live/registration_test.exs b/test/gallium_web/live/user_live/registration_test.exs index be8603a..22ae09e 100644 --- a/test/gallium_web/live/user_live/registration_test.exs +++ b/test/gallium_web/live/user_live/registration_test.exs @@ -48,7 +48,7 @@ defmodule GalliumWeb.UserLive.RegistrationTest do |> follow_redirect(conn, ~p"/users/log-in") assert html =~ - ~r/Foi enviado um email para .*, acede a ele para confirmar a tua conta/ + ~r/Foi enviado um email para .*, acede para confirmar a tua conta/ end test "renders errors for duplicated email", %{conn: conn} do diff --git a/test/gallium_web/live/user_live/settings_test.exs b/test/gallium_web/live/user_live/settings_test.exs index 639c824..60f2da8 100644 --- a/test/gallium_web/live/user_live/settings_test.exs +++ b/test/gallium_web/live/user_live/settings_test.exs @@ -21,7 +21,7 @@ defmodule GalliumWeb.UserLive.SettingsTest do assert {:redirect, %{to: path, flash: flash}} = redirect assert path == ~p"/users/log-in" - assert %{"error" => "Precisa de estar logado para acessar esta página."} = flash + assert %{"error" => "Precisa de ter sessão iniciada para aceder a esta página."} = flash end end @@ -194,7 +194,7 @@ defmodule GalliumWeb.UserLive.SettingsTest do assert {:redirect, %{to: path, flash: flash}} = redirect assert path == ~p"/users/log-in" assert %{"error" => message} = flash - assert message == "Precisa de estar logado para acessar esta página." + assert message == "Precisa de ter sessão iniciada para aceder a esta página." end end end diff --git a/test/gallium_web/user_auth_test.exs b/test/gallium_web/user_auth_test.exs index 33df35b..a1969ba 100644 --- a/test/gallium_web/user_auth_test.exs +++ b/test/gallium_web/user_auth_test.exs @@ -294,7 +294,7 @@ defmodule GalliumWeb.UserAuthTest do assert redirected_to(conn) == ~p"/users/log-in" assert Phoenix.Flash.get(conn.assigns.flash, :error) == - "Precisa de estar logado para acessar esta página." + "Precisa de ter sessão iniciada para aceder a esta página." end test "stores the path to redirect to on GET", %{conn: conn} do