mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
Do not run validatins unless on reconfirmable branch, closes #1515.
This commit is contained in:
@@ -238,6 +238,12 @@ class ConfirmableTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
class ReconfirmableTest < ActiveSupport::TestCase
|
||||
test 'should not worry about validations on confirm even with reconfirmable' do
|
||||
admin = create_admin
|
||||
admin.reset_password_token = "a"
|
||||
assert admin.confirm!
|
||||
end
|
||||
|
||||
test 'should generate confirmation token after changing email' do
|
||||
admin = create_admin
|
||||
assert admin.confirm!
|
||||
|
||||
@@ -7,6 +7,7 @@ module SharedAdmin
|
||||
:unlock_strategy => :time, :lock_strategy => :none,
|
||||
:allow_unconfirmed_access_for => 2.weeks, :reconfirmable => true
|
||||
|
||||
validates_length_of :reset_password_token, :minimum => 3, :allow_blank => true
|
||||
validates_uniqueness_of :email, :allow_blank => true, :if => :email_changed?
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user