mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 14:58:05 -05:00
add a class method so you can encrypt passwords from fixtures
This commit is contained in:
committed by
Vasiliy Ermolovich
parent
93f59dd63a
commit
5300bdabc8
@@ -11,6 +11,16 @@ module Devise
|
||||
end
|
||||
|
||||
class DeviseTest < ActiveSupport::TestCase
|
||||
test 'bcrypt on the class' do
|
||||
password = "super secret"
|
||||
klass = Struct.new(:pepper, :stretches).new("blahblah", 2)
|
||||
hash = Devise.bcrypt(klass, password)
|
||||
assert_equal hash, Devise.bcrypt(klass, password)
|
||||
|
||||
klass = Struct.new(:pepper, :stretches).new("bla", 2)
|
||||
assert_not_equal hash, Devise.bcrypt(klass, password)
|
||||
end
|
||||
|
||||
test 'model options can be configured through Devise' do
|
||||
swap Devise, :allow_unconfirmed_access_for => 113, :pepper => "foo" do
|
||||
assert_equal 113, Devise.allow_unconfirmed_access_for
|
||||
|
||||
Reference in New Issue
Block a user