Skip to content

Commit ba5dd0a

Browse files
kv109lucasmazza
authored andcommitted
test for save in after_create hook breaks devise confirmation [3787]
1 parent f63be50 commit ba5dd0a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/models/confirmable_test.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,4 +486,18 @@ class ReconfirmableTest < ActiveSupport::TestCase
486486
:unconfirmed_email
487487
]
488488
end
489+
490+
test 'should not require reconfirmation after creating a record' do
491+
user = create_admin
492+
assert !user.pending_reconfirmation?
493+
end
494+
495+
test 'should not require reconfirmation after creating a record with #save called in callback' do
496+
class Admin::WithSaveInCallback < Admin
497+
after_create :save
498+
end
499+
500+
user = Admin::WithSaveInCallback.create(valid_attributes.except(:username))
501+
assert !user.pending_reconfirmation?
502+
end
489503
end

0 commit comments

Comments
 (0)