public
Last active

Careful Cutting To Get Faster RSpec Runs with Rails -- fix for Devise

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# 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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.