@@ -48,7 +48,7 @@ def have_hidden_credential_field
4848
4949 describe "#login_with_passkey_form_for" do
5050 it "renders a form with webauthn_get element and hidden credential field" do
51- html = helper . login_with_passkey_form_for ( session_path : "/accounts/sign_in" ) do |form |
51+ html = helper . login_with_passkey_form_for ( :account ) do |form |
5252 form . submit "Log in with passkeys"
5353 end
5454
@@ -60,15 +60,15 @@ def have_hidden_credential_field
6060 end
6161
6262 it "accepts form_classes option" do
63- html = helper . login_with_passkey_form_for ( session_path : "/sign_in" , form_classes : "passkey-form" ) do |form |
63+ html = helper . login_with_passkey_form_for ( :account , form_classes : "passkey-form" ) do |form |
6464 form . submit "Login"
6565 end
6666
6767 expect ( parse ( html ) ) . to have_css ( "form.passkey-form" )
6868 end
6969
7070 it "allows custom content in the block" do
71- html = helper . login_with_passkey_form_for ( session_path : "/sign_in" ) do |form |
71+ html = helper . login_with_passkey_form_for ( :account ) do |form |
7272 helper . content_tag ( :div , class : "button-wrapper" ) do
7373 form . submit "Sign in" , class : "btn-primary"
7474 end
@@ -104,7 +104,7 @@ def have_hidden_credential_field
104104
105105 describe "#login_with_security_key_form_for" do
106106 it "renders a form with webauthn_get element" do
107- html = helper . login_with_security_key_form_for ( resource : user ) do |form |
107+ html = helper . login_with_security_key_form_for ( :account ) do |form |
108108 form . submit "Use security key"
109109 end
110110
@@ -116,15 +116,15 @@ def have_hidden_credential_field
116116 end
117117
118118 it "accepts form_classes option" do
119- html = helper . login_with_security_key_form_for ( resource : user , form_classes : "two-factor-form" ) do |form |
119+ html = helper . login_with_security_key_form_for ( :account , form_classes : "two-factor-form" ) do |form |
120120 form . submit "Verify"
121121 end
122122
123123 expect ( parse ( html ) ) . to have_css ( "form.two-factor-form" )
124124 end
125125
126126 it "allows custom content in the block" do
127- html = helper . login_with_security_key_form_for ( resource : user ) do |form |
127+ html = helper . login_with_security_key_form_for ( :account ) do |form |
128128 helper . safe_join ( [ helper . content_tag ( :p , "Authenticate with your security key" ) , form . submit ( "Authenticate" ) ] )
129129 end
130130
0 commit comments