class PasswordTest

Public Instance Methods

request_forgot_password() { || ... } click to toggle source
# File test/integration/recoverable_test.rb, line 10
def request_forgot_password(&block)
  visit_new_password_path
  assert_response :success
  assert_not warden.authenticated?(:user)

  fill_in 'email', with: 'user@test.com'
  yield if block_given?

  Devise.stubs(:friendly_token).returns("abcdef")
  click_button 'Send me reset password instructions'
end
reset_password(options={}) { || ... } click to toggle source
# File test/integration/recoverable_test.rb, line 22
def reset_password(options={}, &block)
  unless options[:visit] == false
    visit edit_user_password_path(reset_password_token: options[:reset_password_token] || "abcdef")
    assert_response :success
  end

  fill_in 'New password', with: '987654321'
  fill_in 'Confirm new password', with: '987654321'
  yield if block_given?
  click_button 'Change my password'
end
visit_new_password_path() click to toggle source
# File test/integration/recoverable_test.rb, line 5
def visit_new_password_path
  visit new_user_session_path
  click_link 'Forgot your password?'
end