Skip to content

Commit

Permalink
tweak webauthn sign in test
Browse files Browse the repository at this point in the history
  • Loading branch information
colby-swandale committed Dec 4, 2024
1 parent 07810d9 commit de2f8ee
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions test/system/sign_in_webauthn_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class SignInWebauthnTest < ApplicationSystemTestCase

teardown do
@authenticator&.remove!
Capybara.reset_sessions!
Capybara.use_default_driver
end

test "sign in with webauthn mfa" do
Expand All @@ -30,7 +28,7 @@ class SignInWebauthnTest < ApplicationSystemTestCase
click_on "Authenticate with security device"

assert_text "Dashboard"
refute page.has_content? "We now support security devices!"
refute_text "We now support security devices!"
end

test "sign in with webauthn mfa but it expired" do
Expand Down Expand Up @@ -65,8 +63,8 @@ class SignInWebauthnTest < ApplicationSystemTestCase

click_on "Authenticate with security device"

refute page.has_content? "Dashboard"
assert_text "Sign in"
assert_text "Credentials required"
assert_current_path session_path
end

test "sign in with webauthn mfa using recovery codes" do
Expand All @@ -91,7 +89,7 @@ class SignInWebauthnTest < ApplicationSystemTestCase
click_on "Authenticate with security device"

assert_text "Dashboard"
refute page.has_content? "We now support security devices!"
refute_text "We now support security devices!"
end

test "sign in with webauthn failure" do
Expand All @@ -101,7 +99,7 @@ class SignInWebauthnTest < ApplicationSystemTestCase

click_on "Authenticate with security device"

refute page.has_content? "Dashboard"
refute_text "Dashboard"
end

test "sign in with webauthn user_handle changed failure" do
Expand All @@ -111,7 +109,7 @@ class SignInWebauthnTest < ApplicationSystemTestCase

click_on "Authenticate with security device"

refute page.has_content? "Dashboard"
refute_text "Dashboard"
assert_text "Sign in"
end

Expand All @@ -131,7 +129,7 @@ class SignInWebauthnTest < ApplicationSystemTestCase
visit sign_in_path
click_on "Authenticate with security device"

refute page.has_content? "Dashboard"
refute_text "Dashboard"
assert_text "Sign in"
assert_text "Your account was blocked by rubygems team. Please email [email protected] to recover your account."
end
Expand All @@ -142,7 +140,7 @@ class SignInWebauthnTest < ApplicationSystemTestCase
visit sign_in_path
click_on "Authenticate with security device"

refute page.has_content? "Dashboard"
refute_text "Dashboard"
assert_text "Sign in"
end
end

0 comments on commit de2f8ee

Please sign in to comment.