mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-08 22:37:57 -05:00
Use proc to set password length validation so it's possible to override it dynamically.
Co-authored-by: Manoj M J <manojmj92@gmail.com>
This commit is contained in:
@@ -26,8 +26,8 @@ class ActiveRecordTest < ActiveSupport::TestCase
|
||||
test 'validations options are not applied too late' do
|
||||
validators = WithValidation.validators_on :password
|
||||
length = validators.find { |v| v.kind == :length }
|
||||
assert_equal 2, length.options[:minimum]
|
||||
assert_equal 6, length.options[:maximum]
|
||||
assert_equal 2, length.options[:minimum].call
|
||||
assert_equal 6, length.options[:maximum].call
|
||||
end
|
||||
|
||||
test 'validations are applied just once' do
|
||||
|
||||
Reference in New Issue
Block a user