mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 07:40:12 +01:00
Update the maximum password length
This commit is contained in:
parent
4632208699
commit
dd6698b8a1
2 changed files with 3 additions and 3 deletions
|
|
@ -100,7 +100,7 @@ class User < ActiveRecord::Base
|
||||||
|
|
||||||
validates_presence_of :login
|
validates_presence_of :login
|
||||||
validates_presence_of :password, if: :password_required?
|
validates_presence_of :password, if: :password_required?
|
||||||
validates_length_of :password, within: 5..128, if: :password_required?
|
validates_length_of :password, within: 5..72, if: :password_required?
|
||||||
validates_presence_of :password_confirmation, if: :password_required?
|
validates_presence_of :password_confirmation, if: :password_required?
|
||||||
validates_confirmation_of :password
|
validates_confirmation_of :password
|
||||||
validates_length_of :login, within: 3..80
|
validates_length_of :login, within: 3..80
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,8 @@ class UserTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
def test_validate_long_password
|
def test_validate_long_password
|
||||||
assert_no_difference 'User.count' do
|
assert_no_difference 'User.count' do
|
||||||
u = create_user :password => generate_random_string(41)
|
u = create_user :password => generate_random_string(73)
|
||||||
assert_equal "is too long (maximum is 40 characters)", u.errors[:password][0]
|
assert_equal "is too long (maximum is 72 characters)", u.errors[:password][0]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue