From bd9dc4ff23ab1e185df6ccf35d6058c0a3d234ce Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 18 Dec 2010 19:09:07 -0800 Subject: BCrypt does its own salting, lovely! --- activemodel/test/cases/secure_password_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'activemodel/test/cases') diff --git a/activemodel/test/cases/secure_password_test.rb b/activemodel/test/cases/secure_password_test.rb index 7d7c51e6cb..62fffce233 100644 --- a/activemodel/test/cases/secure_password_test.rb +++ b/activemodel/test/cases/secure_password_test.rb @@ -33,6 +33,17 @@ class SecurePasswordTest < ActiveModel::TestCase assert @user.valid? end + test "too weak passwords" do + @user.password = "123456" + assert !@user.valid? + + @user.password = "password" + assert !@user.valid? + + @user.password = "d9034rfjlakj34RR$!!" + assert @user.valid? + end + test "authenticate" do @user.password = "secret" -- cgit v1.2.3