From b5d00831a4a66ff895aa436778c43d60990f81b8 Mon Sep 17 00:00:00 2001 From: Colby Swandale <996377+colby-swandale@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:02:10 +1100 Subject: [PATCH] better handle driver when checking webauthn --- test/system/webauthn_verification_test.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/system/webauthn_verification_test.rb b/test/system/webauthn_verification_test.rb index 629ef9bd719..445742893aa 100644 --- a/test/system/webauthn_verification_test.rb +++ b/test/system/webauthn_verification_test.rb @@ -128,14 +128,17 @@ def assert_link_is_expired end def assert_poll_status(status) + current_driver = Capybara.current_driver + Capybara.current_driver = :rack_test @api_key ||= create(:api_key, key: "12345", scopes: %i[push_rubygem], owner: @user) - Capybara.current_driver = :rack_test page.driver.header "AUTHORIZATION", "12345" visit status_api_v1_webauthn_verification_path(webauthn_token: @verification.path_token, format: :json) assert_equal status, JSON.parse(page.text)["status"] + + Capybara.current_driver = current_driver end def assert_successful_verification_not_found