Skip to content

Instantly share code, notes, and snippets.

@bquorning
Created August 15, 2011 12:05
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bquorning/1146099 to your computer and use it in GitHub Desktop.
Save bquorning/1146099 to your computer and use it in GitHub Desktop.
Careful Cutting To Get Faster RSpec Runs with Rails -- fix for Devise
# Don't need passwords in test DB to be secure, but we would like 'em to be
# fast -- and the stretches mechanism is intended to make passwords
# computationally expensive.
module Devise
module Models
module DatabaseAuthenticatable
def valid_password?(password)
return false if encrypted_password.blank?
encrypted_password == password_digest(password)
end
protected
def password_digest(password)
password
end
end
end
end
Devise.setup do |config|
config.stretches = 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment