From b1f490a2f83630c185a664d7059bb58d23498c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 24 Jul 2012 22:41:13 +0200 Subject: [PATCH] Revert "New password default minimum length is now 8" This reverts commit 2950434ed344610770ad83dd77c9f45b9f01713c. It is backwards incompatible, we need a better migration plan. --- lib/devise.rb | 2 +- lib/generators/templates/devise.rb | 2 +- test/models/validatable_test.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/devise.rb b/lib/devise.rb index 572f63fb97..b0e56dd054 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -91,7 +91,7 @@ module Strategies # Range validation for password length mattr_accessor :password_length - @@password_length = 6..128 + @@password_length = 8..128 # The time the user will be remembered without asking for credentials again. mattr_accessor :remember_for diff --git a/lib/generators/templates/devise.rb b/lib/generators/templates/devise.rb index 3836a61c66..8de8e37b57 100644 --- a/lib/generators/templates/devise.rb +++ b/lib/generators/templates/devise.rb @@ -122,7 +122,7 @@ # ==> Configuration for :validatable # Range for password length. Default is 8..128. - config.password_length = 8..128 + # config.password_length = 8..128 # Email regex used to validate email formats. It simply asserts that # an one (and only one) @ exists in the given string. This is mainly diff --git a/test/models/validatable_test.rb b/test/models/validatable_test.rb index 10be9092c8..a7f1ab443e 100644 --- a/test/models/validatable_test.rb +++ b/test/models/validatable_test.rb @@ -76,10 +76,10 @@ class ValidatableTest < ActiveSupport::TestCase assert_equal 'doesn\'t match confirmation', user.errors[:password].join end - test 'should require a password with minimum of 6 characters' do - user = new_user(:password => '12345', :password_confirmation => '12345') + test 'should require a password with minimum of 8 characters' do + user = new_user(:password => '1234567', :password_confirmation => '1234567') assert user.invalid? - assert_equal 'is too short (minimum is 6 characters)', user.errors[:password].join + assert_equal 'is too short (minimum is 8 characters)', user.errors[:password].join end test 'should require a password with maximum of 128 characters long' do