fix(tests): enable TOTP in final AdminControllerTest

Enable TOTP in impersonation test for superuser authentication flow.
This commit is contained in:
Graham McIntire 2026-03-06 07:45:03 -06:00
parent be9ebff63e
commit b5cf562e55
No known key found for this signature in database

View file

@ -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!()