summaryrefslogtreecommitdiff
path: root/test/controllers/admin_controller_test.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-24 13:53:13 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-24 13:53:13 +0200
commitdcb576618b868b888a5b1b31e35491f300ce4050 (patch)
tree3a970eae416fba2939cd366b1ba2b5d294154f2c /test/controllers/admin_controller_test.rb
parentfefec929c59c72dc93e4be30e8f23cd8c5258b0a (diff)
Complete the login only after the second factor
Enrolled users get a pending marker instead of a session after the password step; a valid code through the challenge writes the real session via reset_session. otp_required without enrollment funnels into setup everywhere except the enrollment, user, and login machinery.
Diffstat (limited to 'test/controllers/admin_controller_test.rb')
-rw-r--r--test/controllers/admin_controller_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/controllers/admin_controller_test.rb b/test/controllers/admin_controller_test.rb
index cba4a59b..a177851f 100644
--- a/test/controllers/admin_controller_test.rb
+++ b/test/controllers/admin_controller_test.rb
@@ -38,4 +38,11 @@ class AdminControllerTest < ActionController::TestCase
38 assert_equal [], json["tags"] 38 assert_equal [], json["tags"]
39 assert_equal [], json["nodes"] 39 assert_equal [], json["nodes"]
40 end 40 end
41
42 test "otp_required users without enrollment are funneled to setup" do
43 users(:quentin).update!(:otp_required => true)
44 login_as :quentin
45 get :index
46 assert_redirected_to edit_user_path(users(:quentin))
47 end
41end 48end