@@ -44,6 +44,7 @@ def generate_assertion(fake_client, challenge:, credential:)
4444
4545 expect ( response ) . to have_http_status ( :ok )
4646 expect ( flash [ :notice ] ) . to eq ( I18n . t ( "devise.failure.two_factor_required" ) )
47+ get account_security_key_authentication_options_path # To set the challenge in session
4748 expect ( session [ :current_authentication_resource_id ] ) . to eq ( user . id )
4849 expect ( session [ :two_factor_authentication_challenge ] ) . not_to be_nil
4950
@@ -83,6 +84,7 @@ def generate_assertion(fake_client, challenge:, credential:)
8384
8485 expect ( response ) . to have_http_status ( :ok )
8586 expect ( flash [ :notice ] ) . to include ( I18n . t ( "devise.failure.two_factor_required" ) )
87+ get account_security_key_authentication_options_path # To set the challenge in session
8688 expect ( session [ :current_authentication_resource_id ] ) . to eq ( user . id )
8789 expect ( session [ :two_factor_authentication_challenge ] ) . not_to be_nil
8890
@@ -112,6 +114,7 @@ def generate_assertion(fake_client, challenge:, credential:)
112114
113115 expect ( response ) . to have_http_status ( :ok )
114116 expect ( flash [ :notice ] ) . to include ( I18n . t ( "devise.failure.two_factor_required" ) )
117+ get account_security_key_authentication_options_path # To set the challenge in session
115118 expect ( session [ :current_authentication_resource_id ] ) . to eq ( user . id )
116119 expect ( session [ :two_factor_authentication_challenge ] ) . not_to be_nil
117120
@@ -142,6 +145,7 @@ def generate_assertion(fake_client, challenge:, credential:)
142145
143146 expect ( response ) . to have_http_status ( :ok )
144147 expect ( flash [ :notice ] ) . to include ( I18n . t ( "devise.failure.two_factor_required" ) )
148+ get account_security_key_authentication_options_path # To set the challenge in session
145149 expect ( session [ :current_authentication_resource_id ] ) . to eq ( user . id )
146150 expect ( session [ :two_factor_authentication_challenge ] ) . not_to be_nil
147151
@@ -169,6 +173,7 @@ def generate_assertion(fake_client, challenge:, credential:)
169173
170174 expect ( response ) . to have_http_status ( :ok )
171175 expect ( flash [ :notice ] ) . to include ( I18n . t ( "devise.failure.two_factor_required" ) )
176+ get account_security_key_authentication_options_path # To set the challenge in session
172177 expect ( session [ :current_authentication_resource_id ] ) . to eq ( user . id )
173178 expect ( session [ :two_factor_authentication_challenge ] ) . not_to be_nil
174179
0 commit comments