test for save in after_create hook breaks devise confirmation [3787]
This commit is contained in:
parent
d22ac4a4fb
commit
a0cd4655ba
|
@ -476,4 +476,18 @@ class ReconfirmableTest < ActiveSupport::TestCase
|
|||
:unconfirmed_email
|
||||
]
|
||||
end
|
||||
|
||||
test 'should not require reconfirmation after creating a record' do
|
||||
user = create_admin
|
||||
assert !user.pending_reconfirmation?
|
||||
end
|
||||
|
||||
test 'should not require reconfirmation after creating a record with #save called in callback' do
|
||||
class Admin::WithSaveInCallback < Admin
|
||||
after_create :save
|
||||
end
|
||||
|
||||
user = Admin::WithSaveInCallback.create(valid_attributes.except(:username))
|
||||
assert !user.pending_reconfirmation?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue