Creating stretches to force encrypting password as many times as possible.

This commit is contained in:
Carlos A. da Silva
2009-10-08 19:16:43 -03:00
parent 5c210d725f
commit 3cc61e4a96
2 changed files with 8 additions and 3 deletions

View File

@@ -92,8 +92,9 @@ class AuthenticableTest < ActiveSupport::TestCase
test 'should encrypt password using a sha1 hash' do
Devise::Authenticable.pepper = 'pepper'
Devise::Authenticable.stretches = 1
user = create_user
expected_password = ::Digest::SHA1.hexdigest("--#{user.password_salt}--pepper--123456--")
expected_password = ::Digest::SHA1.hexdigest("--#{user.password_salt}--pepper--123456--pepper--")
assert_equal expected_password, user.encrypted_password
end