diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-09-30 16:15:56 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-09-30 16:15:56 -0400 |
commit | 9052f13b31944cc1c69af3dec8176fde0bb080a6 (patch) | |
tree | 37340da856a01b22b3f910ed9addbefe8227011a /spec/features/password_reset_spec.rb | |
parent | ceb21cc49f27ddfade4d28e7ad8805d481706922 (diff) | |
download | gitlab-ce-9052f13b31944cc1c69af3dec8176fde0bb080a6.tar.gz |
Remove specs for "login after reset"
We're now using default Devise behavior, so these tests were redundant.
Diffstat (limited to 'spec/features/password_reset_spec.rb')
-rw-r--r-- | spec/features/password_reset_spec.rb | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/spec/features/password_reset_spec.rb b/spec/features/password_reset_spec.rb index deb90a44503..4d512c6543d 100644 --- a/spec/features/password_reset_spec.rb +++ b/spec/features/password_reset_spec.rb @@ -34,50 +34,10 @@ feature 'Password reset', feature: true do end end - describe 'with two-factor authentication' do - it 'requires login after password reset' do - visit root_path - - forgot_password(create(:user, :two_factor)) - reset_password - - expect(page).to have_content("Your password was changed successfully.") - expect(page).not_to have_content("You are now signed in.") - expect(current_path).to eq new_user_session_path - end - end - - describe 'without two-factor authentication' do - it 'requires login after password reset' do - visit root_path - - forgot_password(create(:user)) - reset_password - - expect(page).to have_content("Your password was changed successfully.") - expect(page).not_to have_content("You are now signed in.") - expect(current_path).to eq new_user_session_path - end - end - def forgot_password(user) click_on 'Forgot your password?' fill_in 'Email', with: user.email click_button 'Reset password' user.reload end - - def get_reset_token - mail = ActionMailer::Base.deliveries.last - body = mail.body.encoded - body.scan(/reset_password_token=(.+)\"/).flatten.first - end - - def reset_password(password = 'password') - visit edit_user_password_path(reset_password_token: get_reset_token) - - fill_in 'New password', with: password - fill_in 'Confirm new password', with: password - click_button 'Change your password' - end end |