From b5cf562e55975b449deafaf5397ab1e87c337949 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 6 Mar 2026 07:45:03 -0600 Subject: [PATCH] fix(tests): enable TOTP in final AdminControllerTest Enable TOTP in impersonation test for superuser authentication flow. --- test/towerops_web/controllers/admin_controller_test.exs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/towerops_web/controllers/admin_controller_test.exs b/test/towerops_web/controllers/admin_controller_test.exs index 373255dd..1ff4f27e 100644 --- a/test/towerops_web/controllers/admin_controller_test.exs +++ b/test/towerops_web/controllers/admin_controller_test.exs @@ -68,7 +68,8 @@ defmodule ToweropsWeb.AdminControllerTest do describe "DELETE /admin/impersonate" do test "superuser can stop impersonation of another superuser", %{conn: conn} do superuser = - user_fixture() + [enable_totp: true] + |> user_fixture() |> Ecto.Changeset.change(%{is_superuser: true}) |> Towerops.Repo.update!() @@ -77,7 +78,8 @@ defmodule ToweropsWeb.AdminControllerTest do # Impersonating another superuser so require_superuser passes # (scope.user is the target, which must be superuser to reach the action) other_superuser = - user_fixture() + [enable_totp: true] + |> user_fixture() |> Ecto.Changeset.change(%{is_superuser: true}) |> Towerops.Repo.update!()