diff --git a/app/models/user.rb b/app/models/user.rb index e51f7eb6..686a045e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -100,7 +100,7 @@ class User < ActiveRecord::Base validates_presence_of :login validates_presence_of :password, if: :password_required? - validates_length_of :password, within: 5..40, if: :password_required? + validates_length_of :password, within: 5..72, if: :password_required? validates_presence_of :password_confirmation, if: :password_required? validates_confirmation_of :password validates_length_of :login, within: 3..80 diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 6812dc87..20188647 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -44,8 +44,8 @@ class UserTest < ActiveSupport::TestCase def test_validate_long_password assert_no_difference 'User.count' do - u = create_user :password => generate_random_string(41) - assert_equal "is too long (maximum is 40 characters)", u.errors[:password][0] + u = create_user :password => generate_random_string(73) + assert_equal "is too long (maximum is 72 characters)", u.errors[:password][0] end end