mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Update the tests for 2fa
This commit is contained in:
parent
136f0cd17f
commit
47f64fb711
1 changed files with 4 additions and 3 deletions
|
@ -49,11 +49,12 @@ RSpec.describe Users::SessionsController, type: :controller do
|
|||
end
|
||||
|
||||
context 'when user has 2FA enabled' do
|
||||
it 'renders 2FA page' do
|
||||
it 'redirects to 2fa code form, sets the session and does not sign in the user' do
|
||||
user.two_factor_auth_enabled = true
|
||||
user.save!
|
||||
|
||||
expect(action).to render_template('users/sessions/two_factor_auth')
|
||||
expect(action).to redirect_to(users_two_factor_auth_path)
|
||||
expect(action.request.session[:otp_user_id]).to eq user.id
|
||||
expect { action }.not_to(change { subject.current_user })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue